summaryrefslogtreecommitdiff
path: root/run_tests.sh
Commit message (Collapse)AuthorAgeFilesLines
* Fix likely undesired use of redirectionNikola Dipanov2015-02-021-1/+1
| | | | | | | | Redirection set up like this will not work as expected as the duplication (2>&1 part) is set up before redirection, and thus only stdout ends up getting redirected. Change-Id: I02f47ee69b48a38db348573259d471cd3b236231
* move all tests to nova/tests/unitSean Dague2014-11-121-1/+1
| | | | | | | | | | As part of the split of functional and unit tests we need to isolate the unit tests into a separate directory for having multiple test targets in a sane way. Part of bp:functional-tests-for-nova Change-Id: Id42ba373c1bda6a312b673ab2b489ca56da8c628
* remove use of explicit lockutils invocation in testsSean Dague2014-10-291-2/+2
| | | | | | | | | | | | | | Instead of passing lockutils loading explicitly in the test run command line, provide the support for individual test classes to ask that lock_path is setup with the REQUIRES_LOCKING = True class parameter. Augment all classes that currently fail without this with REQUIRES_LOCKING = True. Hopefully many of those can be individually removed in the future so we can get out of needing external locking in any of our unit tests. Change-Id: I56229e93ad61ac823646a4119a035d36c3400173
* Revert "Switch Nova to use oslo.concurrency"Sean Dague2014-10-281-2/+2
| | | | | | | | | | | This patch made unit tests stop running (always runs 0 unit tests) we should revert and put a check in place to prevent that from happening so that we don't regress the rest of Nova trying to figure out the oslo.concurrency issue. This reverts commit 382294762b08abb1921a77b00608ac941478ce05. Change-Id: I98b04ac2a0ba67ba8af44867799317fdf95b8aff
* Switch Nova to use oslo.concurrencyDavanum Srinivas2014-10-271-2/+2
| | | | | | | Let's switch to the newly released oslo library for the processutils and lockutils. Change-Id: Icf7831261322abd0a6fc5439fe09b1d4cb614cb7
* Provide a quick way to run flake8Matthew Gilliard2014-08-111-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "run_tests.sh -p" always checks every file for errors even though you have probably only changed a handful. This patch adds "run_tests.sh -8" which only checks the files that were modified in the HEAD commit or the current working tree. An unscientific benchmark shows that this can be quite a bit faster: Before: $ time ./run_tests.sh -p Running flake8 ... ./nova/compute/manager.py:77:1: F401 'periodic_task' imported but unused real 0m37.493s user 0m37.391s sys 0m0.099s After: $ time ./run_tests.sh -8 Running flake8 on nova/compute/manager.py ./nova/compute/manager.py:77:1: F401 'periodic_task' imported but unused real 0m0.667s user 0m0.624s sys 0m0.036s Change-Id: I8dafaab40fd0427719040a76c69a8ab05e9e4386
* Fix run_tests.sh lockutils when run with -dNikola Dipanov2014-02-101-1/+1
| | | | | | | | | Change I007bd39e4d9aad7539b4b7389eb5189b5d1f10e2 fixed how the test runner was called, but did not take into account that a different command line is used when -d flag is passed to the script. We fix that but accounting for the lockuitls change even when -d is passed. Change-Id: I7462b70a707fff281fabe9d9f20cbb7bf8d037ef
* Fix interprocess locks for run_tests.shQiu Yu2013-12-251-1/+1
| | | | | | | | | | | | | | In recent change of commit 78d62186e5b0388f740d42cb8da5798cd67d7880 tox test has been switched to use openstack.common.lockutils module for interprocess locks. However, run_tests.sh is left unchanged, which hit a regression when running tests with run_tests.sh This change applies the same change in commit 78d621 for tox.ini to run_tests.sh, i.e. using openstack.common.lockutils to create temporary directory for locks and pass it as env variables to all tests. Closes-Bug: #1264058 Change-Id: I007bd39e4d9aad7539b4b7389eb5189b5d1f10e2
* Add testr concurrency option for run_tests.shQiu Yu2013-10-161-1/+8
| | | | | | | | By exposing this testr concurrency option, run_tests.sh can now specify how many processes to run the tests. If not specified, default 0 utilize maximum CPUs available. Change-Id: I1a518ae67db32d9838e4a3584cfc3af14212be3c
* Merge "emit warning while running flake8 without virtual env"Jenkins2013-09-021-0/+4
|\
| * emit warning while running flake8 without virtual envKui Shi2013-08-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | run_tests.sh -N -p it will call the flake8 installed on your host to detect PEP8, and the flake8 plugin "OpenStack hacking" may not installed on your host, so this command may not detect the OpenStack Style Commandment supplied by hacking(e.g H202). run_tests.sh -p it will call the flake8 from virtual env, flake8 plugin "OpenStack hacking" installed in virtual env will be triggered. The result from "run_tests.sh -p" should be trusted, and jenkins uses virtual env to run flake8 too. When "-N" is enabled, emit warning to remind user. Bug #1215404 Change-Id: Ie503fa34e6a3cf7b1f52f0b53019ddea188dabff
* | Don't need to init testr in run_tests.shKui Shi2013-08-111-7/+0
|/ | | | | | | | | | | | | | | | | | | In run_tests.sh, function init_testr will initialize testr if the directory .testrepository is not existed. Actually, testr will do the check before run the test: In Python package testrepository, setuptools_command.py:Testr.run 68 def run(self): 69 """Set up testr repo, then run testr""" 70 if not os.path.isdir(".testrepository"): 71 self._run_testr("init") So, init_testr can be removed safely. Fixes Bug #1211098 Change-Id: I4bd2ef3dc107281892732efced268eb3b7c90cbb
* Remove unused recreate-db options from run_test.shJoe Gordon2013-07-121-9/+0
| | | | | | | run_tests.sh had an option to delete tests.sqlite, but that file is not used anymore so the run_test options don't do anything. Change-Id: I1abb257579da34c9dd7698543d8297268276bbc5
* Update run_tests.sh to run flake8 too.Monty Taylor2013-05-191-2/+2
| | | | Change-Id: I6fce8ef0a293fb92c7e0ceb4ef88284e93022b54
* Merge "Fix run_tests.sh usage of tools/colorizer.py."Jenkins2013-05-141-1/+8
|\
| * Fix run_tests.sh usage of tools/colorizer.py.Clark Boylan2013-05-131-1/+8
| | | | | | | | | | | | | | | | | | | | | | * run_tests.sh: tools/colorizer.py expects subunit v1 and not v2. Convert the subunit stream to v1 if subunit-2to1 is present (this indicates v2 of subunit is being used) before passing the output on to tools/colorizer.py. Fixes bug #1168516 Change-Id: I6be917181fa8d18764db89e741190964546d0632
* | Transition from openstack.common.setup to pbr.Monty Taylor2013-05-071-0/+4
|/ | | | | | | | | | | Declarative approach to packaging, obviates the need for copying files. Also, removes the need for setup.py to import files from the nova module. ./run_tests.sh now ensure's that nova.egg-info/entry_points.txt is up to date before running tests. Change-Id: I7b7a18e065a62491ade54fbed5d8400db1d4e6c7
* Bring back colorizer again with error results.Vishvananda Ishaya2013-03-261-2/+2
| | | | | | | | | | | This was actually a pretty simple fix. When I switched the base test result class to testtools I lost the methods that were printing out the errors at the end. This adds the (colorized!) methods so errors print successfully. fixes bug 1159116 Change-Id: Ib09d7e18ddf27015ff735a30137421d865382359
* disable colorizer as it swallows failsSean Dague2013-03-231-2/+2
| | | | | | | | | | | | while the colorizer is pretty, it has the problem that fail output actually gets completely swallowed when it is turned on. Revert the use in run_tests.sh for now until it can be sorted out so we don't prevent people from using run_tests.sh to do development. Fixes bug #1159116 Change-Id: I3e6dfdc03c7b033ff132c00a51a368dae9789266
* Bring back sexy colorized test results.Vishvananda Ishaya2013-03-201-2/+2
| | | | | | | Also attempt to keep test results together and print out a nice display of the ten slowest tests. Change-Id: Ib54eb6dede8650ebafc3f069ee7b4a8c4c1a523c
* Merge "Use a fake coverage module instead of real one."Jenkins2013-02-271-4/+0
|\
| * Use a fake coverage module instead of real one.Vishvananda Ishaya2013-02-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually loading the coverage module was leading to odd concurrency conditions where it was interfering with mocked calls. This changes to stub out the coverage class with a fake one so that we don't have to worry about collisions. It also modifies the coverage class to be created lazily so it isn't automatically started at import time. Finally it removes the hack in run_tests.sh ignoring the coverage tests. Fixes bug 1131023 Change-Id: I39de434454f8b0903f6311e731e215a93027bc91
* | Readd run_tests.sh --debug option.Clark Boylan2013-02-231-0/+17
|/ | | | | | | | | | | | | | | | Testr doesn't directly support running tests with pdb so the --debug option was pulled from run_tests.sh during the testr switch. Add the flag back into run_tests.sh and have it run tests with testtools.run which allows users to import pdb in tests then run them without interference from testr. Example usage: # First edit test file to import pdb. run_tests.sh -d path.to.test If the test is not given on the command line all tests will be run. Change-Id: I4afca9ca997ccb6c575b714b778a9db8306c7891
* Make pep8 tests run inside virtualenvHans Lindgren2013-02-161-1/+1
| | | | | | | | | | | Running pep8 results in the following error: Traceback (most recent call last): File "tools/hacking.py", line 34, in <module> import pep8 ImportError: No module named pep8 Change-Id: I31a8bfbffa9ddee306ab414fab367c74d34fdd6b
* Merge "relocatable roots doesn't handle testr args/opts"Jenkins2013-02-151-3/+2
|\
| * relocatable roots doesn't handle testr args/optsChet Burgess2013-02-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Previous fix (4c891b9243985bb95d8beff8affa9db470a1c94a) changed how the args are parsed but didn't update the logic for handling testr args/opts. As a result args/opts for testr where not be properly passed. This fixes corrects that oversite and now properly parses those args as well. Change-Id: I418b0478b2a180e497d041fcab25158c52f44bac Fixes: #1116942
* | Merge "Harmonize PEP8 checking between tox and run_tests.sh"Jenkins2013-02-151-39/+1
|\ \
| * | Harmonize PEP8 checking between tox and run_tests.shRick Harris2013-02-151-39/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tox and run_tests.sh were running PEP8 checks against different file-sets. This patch refactors the logic to determine which files to run PEP8 checks on into `tools/run_pep8.sh` where it can be called by both tox and `run_tests.sh`. Additional fixes: Some of our Python XenAPI Dom0 plugins don't end in *.py but should still be checked by PEP8. This patches fixes the hacking.py violations in the files and adds them back to the srcfiles list. Merged tools/unused_imports.sh into tools/run_pep8.sh Change-Id: Id5edd1acb644ab938beffc3473494a179d9d8cda
* | Add an update option to run_tests.shMatthew Treinish2013-02-141-0/+7
|/ | | | | | | | This commit adds an update option to run_tests.sh. This option is used to rerun install_venv.py on an already installed venv. This will then just update out of date packages with pip. Change-Id: Iac065f71a64a6a7f7f2ee000ee01be9f78af6754
* Module import style checking changesAttila Fazekas2013-02-131-2/+7
| | | | | | | | | | | | | | * Implementing the * import detection (it is disabled for now) * New style relative import testing based on syntax rules * Old style relative import testing based on module search * Inspection based solution replaced by PYTHONPATH search in order to avoid module compile and initialization steps (code execution) in a syntax checking phase. This solution is faster and safer, but does not able to recognize modules added dynamically to the module scope. Change-Id: Ifc871f4fdbcd4a9a736170ceb4475f4f2cbe66bc
* Merge "support reloctable venv roots in testing framework"Jenkins2013-02-111-30/+59
|\
| * support reloctable venv roots in testing frameworkChet Burgess2013-02-071-30/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | run_tests.sh, with_venv.sh, and the install_venv.py scripts now support relocating the venv root to another location. All 3 scripts now support new envinroment variables to configure the location of the venv and the tools directory. To maintain compatability the defaults are set to the current values. venv_path = Location of the virtualenv directory Default: $(pwd) venv_name = Name of the virtualenv directory Default: .venv tools_path = Location of the tools directory Default: $(pwd) Additionally the run_tests.sh script also takes these value as arguments and will pass them along accordingly. --virtual-env-path <path> Location of the virtualenv directory Default: $(pwd) --virtual-env-name <name> Name of the virtualenv directory Default: .venv --tools-path <dir> Location of the tools directory Default: $(pwd) DocImpact Change-Id: I1be036058227206ecca342f692cd3d6aadb24069 Fixes: bug #1116942
* | Ensure 'subunit2pyunit' is run in venv from run_tests.shDaniel P. Berrange2013-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The run_tests.sh script invokes bash -c "${wrapper} $TESTRTESTS | subunit2pyunit" where '${wrapper}' expands to 'tools/with_venv.sh'. Due to shell precedence rules, this only applies to '$TESTRTESTS' not the 'subunit2pyunit' part of the command. The 'subunit2pyunit' binary though may only be available from the .venv Change-Id: I5972c8f77b3f50a3713881e6ca1acbaeabbd47d4 Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* | Parse testr output through subunit2pyunit.Monty Taylor2013-02-031-2/+2
|/ | | | | | | | When running through run_tests.sh, filter the testr output through subunit2pyunit so that incremental progress can be seen. Should be a step towards folks seeing incremental test progress. Change-Id: Ic90669acabaa1c8b64aae80349bff3d3deaf59fa
* Pass testropts in to setup.py in run_tests.shMonty Taylor2013-01-301-2/+2
| | | | Change-Id: Idba469fbd8c0488a308071de45e16eedcb1d6cc6
* Make sure there are no unused importJoe Gordon2013-01-281-0/+1
| | | | | | | Remove all currently unused imports Prevent future unused imports Change-Id: I6ac26d5c71b79952a7732db300355a00310c712e
* Enable N302: Import modules onlyJoe Gordon2013-01-251-1/+1
| | | | | | Fix all N302 issues, and re-enable. Change-Id: Ic94d144c915b228b7ff2fd9c5951875e159ffcdd
* Merge "Fix hacking N302 import only modules"Jenkins2013-01-241-1/+1
|\
| * Fix hacking N302 import only modulesJoe Gordon2013-01-241-1/+1
| | | | | | | | | | | | | | | | * Includes some general tools/hacking cleanup * Fix several N302 cases * Disable N302 until all cases are fixed Change-Id: Iddba07ff13e10dc41a6930749044bb8c0572d279
* | Merge "Generate coverage even if tests failed."Jenkins2013-01-241-7/+7
|\ \
| * | Generate coverage even if tests failed.Robert Collins2013-01-221-7/+7
| | | | | | | | | | | | | | | | | | | | | A test failing doesn't make coverage useless, so we should always generate it. Change-Id: I3ed9e54213c7fb6756906553920d19c5075e1adb
* | | Skip backup files when running pep8.Robert Collins2013-01-241-1/+1
| |/ |/| | | | | | | | | Backup files (foo~) are not interesting for a pep8 report. Change-Id: Ib4a43271c8a0ec47d63e61c45125e3f282415927
* | Use setup.py testr to run testr in run_tests.sh.Clark Boylan2013-01-211-4/+8
| | | | | | | | | | | | | | Using the setup.py testr command in run_tests.sh will sync run_tests.sh up with the way tox currently runs the tests and collects coverage. Change-Id: I21e3965280b3242a860c6be49c4dca44f197b03a
* | Fix nova coverage.Clark Boylan2013-01-211-1/+1
|/ | | | | | | | | | Nova coverage was broken because additional coverage tests were added that interfere with collecting coverage during unit testing. These new tests were not properly excluded by the coverage unit test regex. Modify the regex to exclude any tests of the form '.*test.*coverage.*'. This allows `tox -ecover` and `run_tests.sh --coverage` to run properly. Change-Id: Id35f50ec335707c9eadb0e7fb3aa0833661f7333
* Fix multi line docstring tests in hacking.pyJoe Gordon2013-01-171-1/+1
| | | | | | | | | * Fixes N403, along with docstring test * Adds N404, multi line start * Disable N403 and N404 until all cases are fixed * Remove obsolote '--repeat' flag from tox.ini Change-Id: Ibf6371efc1cdc764e66f6f7c5c4362440101f963
* enable hacking.py self testsSean Dague2013-01-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | pep8 and hacking.py (by inheritance) have the ability to run self tests via docstrings, if we format the comments correctly, and change the docstring test regex. Include self testing in our normal pep8 tests. fix the comments to actually be test case compliant fix nova_import_alphabetical to pass on short import lists (only 2 lines, starting at the beginning of a file) comment where it doesn't appear that hacking.py tests are working (though there could be deeper black magic in some of them). fix a doc string in pep8 self tests that breaks N301 fix the fact that pep8 error strings are supposed to start with \w\d\d\d, we were just lucking out on some formatting because the string NOVA happened to be only 4 chars long. Add a couple of escapes so that we don't recursively fail on our own fail self tests for comments. (boy that's fun) Change-Id: I14d5e04cfc092b37ec4967cd7485e9975a5eb820
* Merge "make runtests -p act more like tox"Jenkins2013-01-101-4/+10
|\
| * make runtests -p act more like toxSean Dague2013-01-101-4/+10
| | | | | | | | | | | | now that all the N402 fixes are in, start enforcing it Change-Id: I9d495849bf698e5af142d0ccafe551ac0e8a600c
* | Fix bash syntax error in run_tests.shAlessio Ababilov2013-01-101-1/+1
|/ | | | | | Spaces are not allowed in bash assignments. Change-Id: Ib80b10802259f5bff2ad0489f9efd763e5995056
* Merge "fix N401 errors, stop ignoring all N4* errors"Jenkins2013-01-091-1/+1
|\