summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMatthew Treinish <mtreinish@kortar.org>2014-09-12 18:54:34 -0400
committerMatthew Treinish <mtreinish@kortar.org>2014-09-15 20:13:44 +0000
commit178cc4a605eb5d23e41f7bb710cae90ddd49e979 (patch)
tree924410d4d748bd457d9cf11f55e17ab8fe465c4d /tools
parent5b240a626eb450a169e2e79f33b4e29b2c4e2d7a (diff)
downloadtempest-178cc4a605eb5d23e41f7bb710cae90ddd49e979.tar.gz
Fail tempest if 0 tests are run
This commit adds a check to subunit-trace to fail if the test run doesn't actually run anything. Despite technically passing without running anything, if you're passing a regex to testr that runs 0 tests that is probably an error, so treat it as such. This also uncovered a bug in the test_wrappers unit test where the test was using a bad test regex but still passsing. Since we start enforcing it here the unit test is also updated to use the proper regex. Change-Id: I109a8cd6eb731e5b8daf5cc2d6a76498ddd48c6d
Diffstat (limited to 'tools')
-rwxr-xr-xtools/subunit-trace.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/subunit-trace.py b/tools/subunit-trace.py
index 8ad59bbab..6ed0b00a0 100755
--- a/tools/subunit-trace.py
+++ b/tools/subunit-trace.py
@@ -285,6 +285,9 @@ def main():
stream.run(result)
finally:
result.stopTestRun()
+ if count_tests('status', '.*') == 0:
+ print("The test run didn't actually run any tests")
+ return 1
if args.post_fails:
print_fails(sys.stdout)
print_summary(sys.stdout)