-
Notifications
You must be signed in to change notification settings - Fork 4
testenv - testing environment manager #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Are the CI servers we use powerful enough to run docker inside them? - Will this significantly slow-down the CI process? Otherwise we might as well stick to your scripts (which I modified and extracted into its own repo: https://github.com/offscale/kv-travis-scripts) Also I'm preparing to build dozens of little cross-platform ANSI C tools, each its own package manager, with a similar API design and idea to
(on Windows replace |
|
Travis does support Docker. If we prebuild the base image and push it to the Docker registry, using Docker will likely speed up the CI process because we won't have to build vcpkg dependencies in Travis each time. However, it's the Linux-only way. To test the library on Mac OS and probably Windows in future we have to stick to the native environments. |
|
Yes, you can make the network fail between calls to library functions. What if such a function does multiple network “operations”/“requests”/whatever? It gets more complicated if you have a constantly-running stream of events, ZooKeeper-style. |
@raid-7 I like the idea of caching the vcpkg process somehow. That seems to be the big time sync. Maybe one of you can setup a vcpkg fork that always pull down new versions, then interjects with its own CD process, create new cached tarballs which will be used by Travis instead of it's own cache for vcpkg? Network namespacing is fine and all, but considering how basic this problem is, our current solution should suffice? |
In this case we can design a framework with special instrumental markers and put the markers in the library functions between those operations. Something like // perform first network request
_test_interceptor();
// perform second network request Control the contents of the marker with macros: #ifdef DEBUG
static void _test_interceptor() {
TestInterceptions::call_intercepted();
}
#else
static void _test_interceptor() {}
#endif And use them in tests like: TEST_F(ClientFixture, conn_failure_test) {
auto suite = TestInterceptions::create_suite();
suite.intercept([](int call_id) {
ConnectionControl::instance().disconnect();
});
ASSERT_THROW(client->set("/key", "value"), liboffkv::ConnectionLoss);
// suite is destroyed, interceptors are detached
} |
See readme
What it enables