Skip to content

Commit 4bcfd92

Browse files
committed
Add --exit-success-on-failures option
1 parent f938ec8 commit 4bcfd92

File tree

1 file changed

+7
-2
lines changed
  • graalpython/com.oracle.graal.python.test/src

1 file changed

+7
-2
lines changed

graalpython/com.oracle.graal.python.test/src/runner.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,11 @@ def main():
12221222
help="Remove tests that were not collected from tags. Useful for pruning removed tests")
12231223
parser.add_argument('--timeout-factor', type=float, default=1.0,
12241224
help="Multiply all timeouts by this number")
1225+
parser.add_argument('--exit-success-on-failures', action='store_true',
1226+
help=dedent("""\
1227+
Exit successfully regardless of the test results. Useful to distinguish test failures
1228+
from runner crashes in jobs like retagger or coverage where failures are expected.
1229+
"""))
12251230
parser.add_argument(
12261231
'--subprocess-args',
12271232
type=shlex.split,
@@ -1232,7 +1237,7 @@ def main():
12321237
] if IS_GRAALPY else [],
12331238
help="Interpreter arguments to pass for subprocess invocation (when using -n)")
12341239
parser.add_argument('tests', nargs='+', type=TestSpecifier.from_str,
1235-
help=dedent("""
1240+
help=dedent("""\
12361241
List of test specifiers. A specifier can be:
12371242
- A test file name. It will be looked up in our unittests or, if you pass --tagged, in tagged tests. Example: test_int
12381243
- A test file path. Example: graalpython/lib-python/3/test/test_int.py. Note you do not need to pass --tagged to refer to a tagged test by path
@@ -1335,7 +1340,7 @@ def main():
13351340
if args.retag_mode:
13361341
runner.generate_tags(append=(args.retag_mode == 'append'))
13371342
return
1338-
if runner.tests_failed():
1343+
if runner.tests_failed() and not args.exit_success_on_failures:
13391344
sys.exit(1)
13401345

13411346

0 commit comments

Comments
 (0)