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
diff --git a/tools/subunit-trace.py b/tools/subunit-trace.py
index 8ad59bb..6ed0b00 100755
--- a/tools/subunit-trace.py
+++ b/tools/subunit-trace.py
@@ -285,6 +285,9 @@
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)