rm pyc files before test runs

It's extremely easy for incorrect local results to happen if a file
has been moved or deleted in an upstream pull. Add the rm pyc cantrip
to ensure local testing matches what a clean upstream is going to be
like as much as possible.

Change-Id: Iecf18d7c2310918ec90c14c64cd3083e46459980
This commit is contained in:
Sean Dague 2014-11-25 08:18:23 -05:00
parent 6f4296e8df
commit c7b4d88c5a

11
tox.ini
View File

@ -17,7 +17,9 @@ install_command = pip install -U {opts} {packages}
whitelist_externals = * whitelist_externals = *
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = bash tools/pretty_tox.sh '{posargs}' commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{posargs}'
[testenv:genconfig] [testenv:genconfig]
commands = oslo-config-generator --config-file tools/config/config-generator.tempest.conf commands = oslo-config-generator --config-file tools/config/config-generator.tempest.conf
@ -33,6 +35,7 @@ setenv = {[tempestenv]setenv}
OS_TEST_TIMEOUT=1200 OS_TEST_TIMEOUT=1200
deps = {[tempestenv]deps} deps = {[tempestenv]deps}
commands = commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{posargs}' bash tools/pretty_tox.sh '{posargs}'
[testenv:full] [testenv:full]
@ -42,6 +45,7 @@ deps = {[tempestenv]deps}
# The regex below is used to select which tests to run and exclude the slow tag: # The regex below is used to select which tests to run and exclude the slow tag:
# See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610 # See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
commands = commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}' bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
[testenv:full-serial] [testenv:full-serial]
@ -51,6 +55,7 @@ deps = {[tempestenv]deps}
# The regex below is used to select which tests to run and exclude the slow tag: # The regex below is used to select which tests to run and exclude the slow tag:
# See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610 # See the testrepostiory bug: https://bugs.launchpad.net/testrepository/+bug/1208610
commands = commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}' bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|thirdparty|cli)) {posargs}'
[testenv:heat-slow] [testenv:heat-slow]
@ -60,6 +65,7 @@ setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps} deps = {[tempestenv]deps}
# The regex below is used to select heat api/scenario tests tagged as slow. # The regex below is used to select heat api/scenario tests tagged as slow.
commands = commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '(?=.*\[.*\bslow\b.*\])(^tempest\.(api|scenario)\.orchestration) {posargs}' bash tools/pretty_tox.sh '(?=.*\[.*\bslow\b.*\])(^tempest\.(api|scenario)\.orchestration) {posargs}'
[testenv:large-ops] [testenv:large-ops]
@ -67,6 +73,7 @@ sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv} setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps} deps = {[tempestenv]deps}
commands = commands =
find . -type f -name "*.pyc" -delete
python setup.py testr --slowest --testr-args='tempest.scenario.test_large_ops {posargs}' python setup.py testr --slowest --testr-args='tempest.scenario.test_large_ops {posargs}'
[testenv:smoke] [testenv:smoke]
@ -74,6 +81,7 @@ sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv} setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps} deps = {[tempestenv]deps}
commands = commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}' bash tools/pretty_tox.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}'
[testenv:smoke-serial] [testenv:smoke-serial]
@ -84,6 +92,7 @@ deps = {[tempestenv]deps}
# https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke # https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke
# job would fail if we moved it to parallel. # job would fail if we moved it to parallel.
commands = commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}' bash tools/pretty_tox_serial.sh '(?!.*\[.*\bslow\b.*\])((smoke)|(^tempest\.scenario)) {posargs}'
[testenv:stress] [testenv:stress]