tox -epy27 succeeds when no tests are run

Bug #1211648 reported by Joe Gordon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Wishlist
Unassigned

Bug Description

tox -epy27 succeeds when no tests are run.

If running 'tox -epy27 thisisabadregex'

$ tox -epy27 thisisabadregex
GLOB sdist-make: ~/nova/setup.py
py27 inst-nodeps: ~/nova/.tox/dist/nova-2013.2.a2543.g3f5ad03.zip
py27 runtests: commands[0] | python tools/patch_tox_venv.py
py27 runtests: commands[1] | python setup.py testr --slowest --testr-args=thisisabadregex
running testr
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ ./nova/tests --list
PASSED (id=385)
Slowest Tests
____________________________________________________________________________________ summary ____________________________________________________________________________________
  py27: commands succeeded
  congratulations :)

While technically correct this is misleading and I cannot imagine a case where running no tests is the expected behavior

Revision history for this message
Matt Riedemann (mriedem) wrote :

I've seen this too. I've ran tox with some changes to the db migration scripts for DB2 support and I had a bug which made them completely bomb out and tox never reported a problem, it just said that no tests ran. When I used run_tests.sh it correctly showed the failures.

Changed in nova:
status: New → Confirmed
Revision history for this message
Sean Dague (sdague) wrote :

We actually have some nice scripts in tempest for stuff like this.

Changed in nova:
importance: Undecided → High
Revision history for this message
Matthew Treinish (treinish) wrote :

So the tempest scripts actually don't catch this case either, but it was simple enough to fix. I pushed out:

https://review.openstack.org/#/c/121261

To catch this condition and fail if no tests are run. Once this patch and the other in progress subunit-trace patch (https://review.openstack.org/92497 ) land I'll move it over to tempest-lib and expose it as an entry point in the first release. Which should hopefully be next week assuming everything makes it through the gate reasonably quickly.

Then to fix this on the nova side you'll just need to add tempest-lib to the test-requirements and pipe the subunit stream from testr into subunit-trace to handle this.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Moving to wishlist unless some really objects :)

Changed in nova:
importance: High → Wishlist
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

dims@dims-mac:~/openstack/nova$ tox -epy27 thisisabadregex
py27 create: /Users/dims/openstack/nova/.tox/py27
py27 installdeps: -r/Users/dims/openstack/nova/requirements.txt, -r/Users/dims/openstack/nova/test-requirements.txt
py27 develop-inst: /Users/dims/openstack/nova
py27 runtests: PYTHONHASHSEED='0'
py27 runtests: commands[0] | find . -type f -name *.pyc -delete
py27 runtests: commands[1] | bash tools/pretty_tox.sh thisisabadregex
running testr
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./nova/tests} --list
Slowest Tests
The test run didn't actually run any tests
ERROR: InvocationError: '/bin/bash tools/pretty_tox.sh thisisabadregex'
________________________________________________________________________________________________________________________ summary _________________________________________________________________________________________________________________________
ERROR: py27: commands failed

Changed in nova:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.