Mercurial > hg
changeset 27567:54bc0e884385
run-tests: avoid double counting server fails
author | timeless <timeless@mozdev.org> |
---|---|
date | Mon, 28 Dec 2015 16:01:31 +0000 |
parents | 5d6f984c8375 |
children | 34b01a51bd42 |
files | tests/run-tests.py tests/test-run-tests.t |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Mon Dec 14 23:50:02 2015 +0900 +++ b/tests/run-tests.py Mon Dec 28 16:01:31 2015 +0000 @@ -585,6 +585,8 @@ result.testsRun -= 1 except WarnTest as e: result.addWarn(self, str(e)) + except ReportedTest as e: + pass except self.failureException as e: # This differs from unittest in that we don't capture # the stack trace. This is for historical reasons and @@ -1243,6 +1245,9 @@ class WarnTest(Exception): """Raised to indicate that a test warned.""" +class ReportedTest(Exception): + """Raised to indicate that a test already reported.""" + class TestResult(unittest._TextTestResult): """Holds results when executing via unittest.""" # Don't worry too much about accessing the non-public _TextTestResult. @@ -1361,6 +1366,7 @@ self.addFailure( test, 'server failed to start (HGPORT=%s)' % test._startport) + raise ReportedTest('server failed to start') else: self.stream.write('\n') for line in lines:
--- a/tests/test-run-tests.t Mon Dec 14 23:50:02 2015 +0900 +++ b/tests/test-run-tests.t Mon Dec 28 16:01:31 2015 +0000 @@ -209,8 +209,6 @@ Verify that when a process fails to start we show a useful message ================================================================== -NOTE: there is currently a bug where this shows "2 failed" even though -it's actually the same test being reported for failure twice. $ cat > test-serve-fail.t <<EOF > $ echo 'abort: child process failed to start blah' @@ -219,11 +217,8 @@ ERROR: test-serve-fail.t output changed ! - ERROR: test-serve-fail.t output changed - ! Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob) - Failed test-serve-fail.t: output changed - # Ran 1 tests, 0 skipped, 0 warned, 2 failed. + # Ran 1 tests, 0 skipped, 0 warned, 1 failed. python hash seed: * (glob) [1] $ rm test-serve-fail.t