aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAng Li <angli@google.com>2023-01-15 18:14:26 -0800
committerGitHub <noreply@github.com>2023-01-16 10:14:26 +0800
commit86688d320670f924e709340c0d84b306fbbf2a17 (patch)
tree30dbed2bbc49ed749ef30053ad46926ea79135c6
parent1c44fd97c968c5d1eba4ee6a1ef988b814a150d9 (diff)
downloadmobly-86688d320670f924e709340c0d84b306fbbf2a17.tar.gz
Make the summary file path more accessible. (#865)
This file is the entry point of all result parsing. We make this path clear so the upper layer systems don't have to calculate it with assumptions that may change implicitly.
-rw-r--r--mobly/test_runner.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mobly/test_runner.py b/mobly/test_runner.py
index 9c91477..624f056 100644
--- a/mobly/test_runner.py
+++ b/mobly/test_runner.py
@@ -252,6 +252,10 @@ class TestRunner:
self._logger_start_time)
return self.root_output_path
+ @property
+ def summary_file_path(self):
+ return os.path.join(self.root_output_path, records.OUTPUT_FILE_SUMMARY)
+
def set_start_point(self):
"""Sets the start point of a test run.
@@ -401,8 +405,7 @@ class TestRunner:
utils.create_dir(self._test_run_metadata.root_output_path)
summary_writer = records.TestSummaryWriter(
- os.path.join(self._test_run_metadata.root_output_path,
- records.OUTPUT_FILE_SUMMARY))
+ self._test_run_metadata.summary_file_path)
# When a SIGTERM is received during the execution of a test, the Mobly test
# immediately terminates without executing any of the finally blocks. This
@@ -439,6 +442,7 @@ class TestRunner:
f'Summary for test run {self._test_run_metadata.run_id}:',
f'Total time elapsed {self._test_run_metadata.time_elapsed_sec}s',
f'Artifacts are saved in "{self._test_run_metadata.root_output_path}"',
+ f'Test summary saved in "{self._test_run_metadata.summary_file_path}"',
f'Test results: {self.results.summary_str()}'
]
logging.info('\n'.join(summary_lines))