diff options
-rw-r--r-- | buildscripts/resmokelib/config.py | 4 | ||||
-rw-r--r-- | buildscripts/resmokelib/parser.py | 9 | ||||
-rw-r--r-- | buildscripts/resmokelib/testing/report.py | 3 |
3 files changed, 15 insertions, 1 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py index b3ff831669a..91d44bd0ad1 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py @@ -50,6 +50,7 @@ DEFAULTS = { "nojournal": False, "numClientsPerFixture": 1, "repeat": 1, + "reportFailureStatus": "fail", "reportFile": None, "seed": long(time.time() * 256), # Taken from random.py code in Python 2.7. "shellReadMode": None, @@ -133,6 +134,9 @@ RANDOM_SEED = None # If set, then each suite is repeated the specified number of times. REPEAT = None +# Controls if the test failure status should be reported as failed or be silently ignored. +REPORT_FAILURE_STATUS = None + # If set, then resmoke.py will write out a report file with the status of each test that ran. REPORT_FILE = None diff --git a/buildscripts/resmokelib/parser.py b/buildscripts/resmokelib/parser.py index 2e981fab4d1..8d9ce7fbf27 100644 --- a/buildscripts/resmokelib/parser.py +++ b/buildscripts/resmokelib/parser.py @@ -36,6 +36,7 @@ DEST_TO_CONFIG = { "num_clients_per_fixture": "numClientsPerFixture", "prealloc_journal": "preallocJournal", "repeat": "repeat", + "report_failure_status": "reportFailureStatus", "report_file": "reportFile", "seed": "seed", "shell_read_mode": "shellReadMode", @@ -165,6 +166,13 @@ def parse_command_line(): parser.add_option("--repeat", type="int", dest="repeat", metavar="N", help="Repeat the given suite(s) N times, or until one fails.") + parser.add_option("--reportFailureStatus", type="choice", action="store", + dest="report_failure_status", choices=("fail", "silentfail"), + metavar="STATUS", + help="Controls if the test failure status should be reported as failed" + " or be silently ignored (STATUS=silentfail). Defaults to" + " STATUS=%default.") + parser.add_option("--reportFile", dest="report_file", metavar="REPORT", help="Write a JSON file with test status and timing information.") @@ -255,6 +263,7 @@ def update_config_vars(values): _config.NUM_CLIENTS_PER_FIXTURE = config.pop("numClientsPerFixture") _config.RANDOM_SEED = config.pop("seed") _config.REPEAT = config.pop("repeat") + _config.REPORT_FAILURE_STATUS = config.pop("reportFailureStatus") _config.REPORT_FILE = config.pop("reportFile") _config.SHELL_READ_MODE = config.pop("shellReadMode") _config.SHELL_WRITE_MODE = config.pop("shellWriteMode") diff --git a/buildscripts/resmokelib/testing/report.py b/buildscripts/resmokelib/testing/report.py index 365d8662065..18e3edb63e3 100644 --- a/buildscripts/resmokelib/testing/report.py +++ b/buildscripts/resmokelib/testing/report.py @@ -10,6 +10,7 @@ import threading import time import unittest +from .. import config as _config from .. import logging @@ -278,7 +279,7 @@ class TestReport(unittest.TestResult): status = test_info.status if status == "error": # Don't distinguish between failures and errors. - status = "fail" + status = _config.REPORT_FAILURE_STATUS elif status == "timeout": # Until EVG-1536 is completed, we shouldn't distinguish between failures and # interrupted tests in the report.json file. In Evergreen, the behavior to sort |