summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing/report.py
diff options
context:
space:
mode:
authorYves Duhem <yves.duhem@mongodb.com>2018-08-29 10:35:33 -0400
committerYves Duhem <yves.duhem@mongodb.com>2018-08-29 10:35:43 -0400
commitd92fe6cd9242a22e8ae56f48e64a20770d9e8291 (patch)
treeba851f3cc0a8c109c2df5a1863ad88bd995befb9 /buildscripts/resmokelib/testing/report.py
parent78901fd754958d57b914e7209e702eec53543d81 (diff)
downloadmongo-d92fe6cd9242a22e8ae56f48e64a20770d9e8291.tar.gz
SERVER-34593 New resmoke option to repeat tests
Diffstat (limited to 'buildscripts/resmokelib/testing/report.py')
-rw-r--r--buildscripts/resmokelib/testing/report.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/buildscripts/resmokelib/testing/report.py b/buildscripts/resmokelib/testing/report.py
index c968449c8a2..c1ba466f681 100644
--- a/buildscripts/resmokelib/testing/report.py
+++ b/buildscripts/resmokelib/testing/report.py
@@ -94,7 +94,7 @@ class TestReport(unittest.TestResult): # pylint: disable=too-many-instance-attr
unittest.TestResult.startTest(self, test)
- test_info = _TestInfo(test.id(), dynamic)
+ test_info = _TestInfo(test.id(), test.test_name, dynamic)
test_info.start_time = time.time()
basename = test.basename()
@@ -262,7 +262,7 @@ class TestReport(unittest.TestResult): # pylint: disable=too-many-instance-attr
with self._lock:
for test_info in self.test_infos:
result = {
- "test_file": test_info.test_id,
+ "test_file": test_info.test_file,
"status": test_info.evergreen_status,
"exit_code": test_info.return_code,
"start": test_info.start_time,
@@ -292,7 +292,10 @@ class TestReport(unittest.TestResult): # pylint: disable=too-many-instance-attr
for result in report_dict["results"]:
# By convention, dynamic tests are named "<basename>:<hook name>".
is_dynamic = ":" in result["test_file"]
- test_info = _TestInfo(result["test_file"], is_dynamic)
+ test_file = result["test_file"]
+ # Using test_file as the test id is ok here since the test id only needs to be unique
+ # during suite execution.
+ test_info = _TestInfo(test_file, test_file, is_dynamic)
test_info.url_endpoint = result.get("url")
test_info.status = result["status"]
test_info.evergreen_status = test_info.status
@@ -341,10 +344,11 @@ class TestReport(unittest.TestResult): # pylint: disable=too-many-instance-attr
class _TestInfo(object): # pylint: disable=too-many-instance-attributes
"""Holder for the test status and timing information."""
- def __init__(self, test_id, dynamic):
+ def __init__(self, test_id, test_file, dynamic):
"""Initialize the _TestInfo instance."""
self.test_id = test_id
+ self.test_file = test_file
self.dynamic = dynamic
self.start_time = None