Bug 1473392 - Fix failure conditions for all mochitest tests. r=jmaher

This patch changes the failure condition of all mochitest tests to take the number of failures (given by self.countfail). It also adds a condition to check if there are passing and todo counts, and if there are not, the test chunk fails. With this change, mochitest test chunks will fail if the failure count is not 0, or all the counts (pass, todo, and fail) are 0. This fixes a case where the TODO tests were considered as failures when no passing tests were run along side them.

Differential Revision: https://phabricator.services.mozilla.com/D3612

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Greg Mierzwinski 2018-08-17 14:09:42 +00:00
parent b212948c3b
commit 1a93f7f34a

View File

@ -2643,9 +2643,12 @@ toolbar#nav-bar {
print("4 INFO Mode: %s" % e10s_mode)
print("5 INFO SimpleTest FINISHED")
if not result and not self.countpass:
# either tests failed or no tests run
result = 1
if not result:
if self.countfail or \
not (self.countpass or self.counttodo):
# at least one test failed, or
# no tests passed, and no tests failed (possibly a crash)
result = 1
return result