Skip to content

Commit

Permalink
Bug 1872171 - add and support --restartAfterFailure for desktop mochi…
Browse files Browse the repository at this point in the history
…tests. r=ahal

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

UltraBlame original commit: 39c1f4cb2135dc97883ba694417a713f52325891
  • Loading branch information
marco-c committed Jan 16, 2024
1 parent 4858324 commit 8f82f40
Show file tree
Hide file tree
Showing 8 changed files with 784 additions and 10 deletions.
54 changes: 54 additions & 0 deletions testing/mochitest/mochitest_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -6078,6 +6078,60 @@

}

]

[

[
"
-
-
restart
-
after
-
failure
"
]

{

"
dest
"
:
"
restartAfterFailure
"

"
default
"
:
False

"
help
"
:
"
Terminate
the
session
on
first
failure
and
restart
where
you
left
off
.
"

}

]

]
Expand Down
143 changes: 143 additions & 0 deletions testing/mochitest/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18536,6 +18536,10 @@
=
None

restartAfterFailure
=
False

marionette_args
=
None
Expand Down Expand Up @@ -19045,6 +19049,10 @@
bisectChunk
=
bisectChunk

restartAfterFailure
=
restartAfterFailure

)

Expand Down Expand Up @@ -20838,6 +20846,109 @@
result
)

elif
options
.
restartAfterFailure
:

if
not
self
.
expectedError
:

status
=
-
1

else
:

firstFail
=
len
(
testsToRun
)

for
key
in
self
.
expectedError
:

full_key
=
[
x
for
x
in
testsToRun
if
key
in
x
]

if
full_key
:

if
testsToRun
.
index
(
full_key
[
0
]
)
<
firstFail
:

firstFail
=
testsToRun
.
index
(
full_key
[
0
]
)

testsToRun
=
testsToRun
[
firstFail
+
1
:
]

if
testsToRun
=
=
[
]
:

status
=
-
1

else
:

Expand Down Expand Up @@ -24756,6 +24867,12 @@
.
bisectChunk

restartAfterFailure
=
options
.
restartAfterFailure

marionette_args
=
marionette_args
Expand Down Expand Up @@ -25808,6 +25925,10 @@
bisectChunk
=
None

restartAfterFailure
=
None

)
:
Expand Down Expand Up @@ -25885,6 +26006,12 @@
=
bisectChunk

self
.
restartAfterFailure
=
restartAfterFailure

self
.
browserProcessId
Expand Down Expand Up @@ -26036,6 +26163,10 @@
self
.
bisectChunk
or
self
.
restartAfterFailure
:

handlers
Expand Down Expand Up @@ -27444,6 +27575,18 @@
=
True

if
options
.
restartAfterFailure
:

options
.
runUntilFailure
=
True

if
options
.
Expand Down
4 changes: 4 additions & 0 deletions testing/mochitest/runtestsremote.py
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,10 @@
=
None

restartAfterFailure
=
False

marionette_args
=
None
Expand Down
5 changes: 5 additions & 0 deletions testing/mochitest/tests/SimpleTest/TestRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,11 @@ _numTimeouts
TestRunner
.
maxTimeouts
|
|
TestRunner
.
runUntilFailure
)
{
TestRunner
Expand Down
Loading

0 comments on commit 8f82f40

Please sign in to comment.