summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2017-04-03 11:33:09 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2017-04-03 11:33:09 -0400
commitabeacd95726365e00f35d00f4cb348c703224042 (patch)
tree06bbfd694cdeb1b987c07a3a873090f306a74120
parentb95082ab3ffa4517b79e09c71a27b846c386fc04 (diff)
downloadmongo-abeacd95726365e00f35d00f4cb348c703224042.tar.gz
SERVER-28439 Add "silentfail" test status and --reportFailureStatus option to resmoke.py
-rw-r--r--buildscripts/resmokelib/config.py4
-rw-r--r--buildscripts/resmokelib/parser.py9
-rw-r--r--buildscripts/resmokelib/testing/report.py3
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