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
Various test speed ups #3465
Merged
Merged
Various test speed ups #3465
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This way no requirements are installed in a created virtualenv which speeds up tests.
{setup,create}_pack_virtualenv function.
don't need it. This speeds up test run by 90% or so.
downloading less stuff.
This reduces the test run time.
disks. We have way too many test fixture packs on disk and registering resources from all inside the test takes a long time. With this change tests are now substantially faster.
@@ -10,6 +10,8 @@ machine: | |||
# We add /tmp/mongodb/bin/ directory to PATH so the correct and latest version of mongo shell | |||
# binary is used. | |||
PATH: /tmp/mongodb/bin/:${PATH} | |||
# Enable nose timing info so per test case test timing is printed at the end | |||
NOSE_TIME: "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+100.
Merged
arm4b
approved these changes
Jun 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request contains speed ups for various "offensive" tests which took a long time.
For information on how speed ups were achieved, please refer to the actual git commit messages and code changes (and ask for clarification, if needed).
Speed ups
Before
(virtualenv)vagrant@vagrant-ubuntu-trusty-64:/data/stanley$ nosetests --with-timer --nocapture -v st2common/tests/unit/test_virtualenvs.py test_setup_pack_virtualenv_already_exists (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (8.5302s) test_setup_pack_virtualenv_doesnt_exist_yet (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (5.0522s) test_setup_virtualenv_invalid_dependency_in_requirements_file (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (10.7242s) test_setup_virtualenv_update (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (5.6160s) [success] 35.84% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_virtualenv_invalid_dependency_in_requirements_file: 10.7242s [success] 28.51% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_pack_virtualenv_already_exists: 8.5302s [success] 18.77% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_virtualenv_update: 5.6160s [success] 16.88% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_pack_virtualenv_doesnt_exist_yet: 5.0522s ---------------------------------------------------------------------- Ran 4 tests in 29.929s
After:
(virtualenv)vagrant@vagrant-ubuntu-trusty-64:/data/stanley$ nosetests --with-timer --nocapture -v st2common/tests/unit/test_virtualenvs.py test_setup_pack_virtualenv_already_exists (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (0.2725s) test_setup_pack_virtualenv_doesnt_exist_yet (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (0.1489s) test_setup_virtualenv_invalid_dependency_in_requirements_file (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (3.1897s) test_setup_virtualenv_update (tests.unit.test_virtualenvs.VirtualenvUtilsTestCase) ... ok (3.7518s) [success] 50.96% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_virtualenv_update: 3.7518s [success] 43.32% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_virtualenv_invalid_dependency_in_requirements_file: 3.1897s [success] 3.70% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_pack_virtualenv_already_exists: 0.2725s [success] 2.02% tests.unit.test_virtualenvs.VirtualenvUtilsTestCase.test_setup_pack_virtualenv_doesnt_exist_yet: 0.1489s ---------------------------------------------------------------------- Ran 4 tests in 7.368s OK