diff --git a/osbenchmark/aggregator.py b/osbenchmark/aggregator.py index 02676daa..dbc29d57 100644 --- a/osbenchmark/aggregator.py +++ b/osbenchmark/aggregator.py @@ -241,7 +241,7 @@ def aggregate(self) -> None: aggregated_results = self.build_aggregated_results() file_test_exe_store = FileTestExecutionStore(self.config) - file_test_exe_store.store_test_execution(aggregated_results) + file_test_exe_store.store_aggregated_execution(aggregated_results) else: raise ValueError("Incompatible test execution results") diff --git a/osbenchmark/metrics.py b/osbenchmark/metrics.py index 80751224..2ece366a 100644 --- a/osbenchmark/metrics.py +++ b/osbenchmark/metrics.py @@ -1549,6 +1549,14 @@ def store_test_execution(self, test_execution): io.ensure_dir(test_execution_path) with open(self._test_execution_file(), mode="wt", encoding="utf-8") as f: f.write(json.dumps(doc, indent=True, ensure_ascii=False)) + + def store_aggregated_execution(self, test_execution): + doc = test_execution.as_dict() + aggregated_execution_path = paths.aggregated_results_root(self.cfg, test_execution_id=test_execution.test_execution_id) + io.ensure_dir(aggregated_execution_path) + aggregated_file = os.path.join(aggregated_execution_path, "test_execution.json") + with open(aggregated_file, mode="wt", encoding="utf-8") as f: + f.write(json.dumps(doc, indent=True, ensure_ascii=False)) def _test_execution_file(self, test_execution_id=None): return os.path.join(paths.test_execution_root(cfg=self.cfg, test_execution_id=test_execution_id), "test_execution.json") diff --git a/osbenchmark/paths.py b/osbenchmark/paths.py index 869c7f9c..305275fe 100644 --- a/osbenchmark/paths.py +++ b/osbenchmark/paths.py @@ -42,6 +42,10 @@ def test_execution_root(cfg, test_execution_id=None): test_execution_id = cfg.opts("system", "test_execution.id") return os.path.join(test_excecutions_root(cfg), test_execution_id) +def aggregated_results_root(cfg, test_execution_id=None): + if not test_execution_id: + test_execution_id = cfg.opts("system", "test_execution.id") + return os.path.join(cfg.opts("node", "root.dir"), "aggregated_results", test_execution_id) def install_root(cfg=None): install_id = cfg.opts("system", "install.id")