-
Notifications
You must be signed in to change notification settings - Fork 24
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
Tests too slow, need much faster feedback #14
Comments
Plan:
|
Ideally we'd just leave the current suite as is (they are integration tests after all) and write a completely separate "unit" suite with mocks and stuff that runs fast. What do you think ? |
I can help adding a testing skeleton and regrouping tests for this to work and maybe some start tests with mocks/stubs. Are you interested in working on the bulk of the 'fast' suite - further reorganisation etc? For the separation we could have a "FAST/SLOW" switch via environment variable (so you can still run tox for both). Or we could have 2 sets of tox environments - the default list of envs will be the fast ones. |
I don't think we need unit tests and specially not complicated mocking and stubs. This is very simple code with almost no logic, reusing ready components (like the interactive console). I think we need simple integration tests that run quickly and provide fast feedback when you change stuff, and stress tests to catch those rare issues that happen only under load. I think the simplest way to have both kind of tests would be to mark stress tests using a decorator that skip these tests unless an environment variable is set: For example:
Running stress tests:
Similar system works nicely for vdsm: In the vdsm, it need much more code, because we use nose plugins The simple code above is the only code needed to support this, and The nice thing about this system is that it is very easy to add tests, and |
This one |
Even after #13, tests are too slow.
$ tox -e 2.7 -- py.test -v --durations=10
2.7 develop-inst-nodeps: /home/nsoffer/src/python-manhole
2.7 runtests: PYTHONHASHSEED='4080427460'
2.7 runtests: commands[0] | py.test -v --durations=10
============================================================================= test session starts ==============================================================================
platform linux2 -- Python 2.7.5 -- py-1.4.23 -- pytest-2.6.1 -- /home/nsoffer/src/python-manhole/.tox/2.7/bin/python2.7
plugins: cov, capturelog
collected 14 items
tests/test_manhole.py::test_simple PASSED
tests/test_manhole.py::test_fork_exec PASSED
tests/test_manhole.py::test_socket_path PASSED
tests/test_manhole.py::test_socket_path_with_fork PASSED
tests/test_manhole.py::test_exit_with_grace PASSED
tests/test_manhole.py::test_with_fork PASSED
tests/test_manhole.py::test_with_forkpty PASSED
tests/test_manhole.py::test_auth_fail PASSED
tests/test_manhole.py::test_activate_on_usr2 PASSED
tests/test_manhole.py::test_activate_on_with_oneshot_on PASSED
tests/test_manhole.py::test_oneshot_on_usr2 PASSED
tests/test_manhole.py::test_fail_to_cry PASSED
tests/test_manhole.py::test_oneshot_on_usr2_error PASSED
tests/test_manhole.py::test_interrupt_on_accept PASSED
========================================================================== slowest 10 test durations ===========================================================================
11.11s call tests/test_manhole.py::test_oneshot_on_usr2_error
10.81s call tests/test_manhole.py::test_oneshot_on_usr2
10.70s call tests/test_manhole.py::test_activate_on_usr2
4.39s call tests/test_manhole.py::test_simple
2.62s call tests/test_manhole.py::test_with_fork
2.57s call tests/test_manhole.py::test_with_forkpty
2.56s call tests/test_manhole.py::test_socket_path_with_fork
2.12s call tests/test_manhole.py::test_interrupt_on_accept
1.16s call tests/test_manhole.py::test_fork_exec
0.61s call tests/test_manhole.py::test_exit_with_grace
==================================================================== 14 passed, 2 warnings in 49.98 seconds ====================================================================
The text was updated successfully, but these errors were encountered: