diff --git a/pytest_abra/cli.py b/pytest_abra/cli.py index 53d534b..2a9c3ae 100644 --- a/pytest_abra/cli.py +++ b/pytest_abra/cli.py @@ -37,7 +37,7 @@ def run(): # todo: move to Coordinator DIR = DirManager(output_dir=args.output_dir, session_id=session_id) - log_file = DIR.RECORDS / "coordinator.log" + log_file = DIR.RESULTS / "coordinator.log" logger.add(log_file) # ---------------------------- initialize and run ---------------------------- # diff --git a/pytest_abra/coordinator.py b/pytest_abra/coordinator.py index b599458..8819388 100644 --- a/pytest_abra/coordinator.py +++ b/pytest_abra/coordinator.py @@ -60,13 +60,13 @@ class Coordinator: def combine_html(self) -> None: """combines all generated pytest html reports into one""" - in_dir_path = str(self.DIR.RECORDS / "html") - out_file_path = str(self.DIR.RECORDS / "full-report.html") + in_dir_path = str(self.DIR.RESULTS / "html") + out_file_path = str(self.DIR.RESULTS / "full-report.html") title = "combined.html" merge_html_reports(in_dir_path, out_file_path, title) def collect_traces(self): - """moves all traces into SESSION/RECORDS dir + """moves all traces into SESSION/RESULTS dir if tests are rerun and generate another trace, the new trace will get a unique name such as tracename-0 @@ -82,9 +82,9 @@ class Coordinator: index += 1 return get_new_path(root_dir, base_name, index=index) - trace_root_dir = self.DIR.RECORDS / "traces" + trace_root_dir = self.DIR.RESULTS / "traces" for f in trace_root_dir.rglob("*/trace.zip"): - new_path = get_new_path(self.DIR.RECORDS, f.parent.name) + new_path = get_new_path(self.DIR.RESULTS, f.parent.name) f.parent.rename(new_path) rmtree(trace_root_dir) diff --git a/pytest_abra/custom_fixtures.py b/pytest_abra/custom_fixtures.py index 82bc0bd..d627812 100644 --- a/pytest_abra/custom_fixtures.py +++ b/pytest_abra/custom_fixtures.py @@ -49,9 +49,9 @@ def DIR(request) -> DirManager: DIR.OUTPUT DIR.SESSION - DIR.RECORDS DIR.STATES - DIR.RESULTS""" + DIR.RESULTS + DIR.STATUS""" output_dir = request.config.getoption("--output_dir") assert output_dir, "pytest argument --output_dir not set" diff --git a/pytest_abra/dir_manager.py b/pytest_abra/dir_manager.py index c54954b..b290ab5 100644 --- a/pytest_abra/dir_manager.py +++ b/pytest_abra/dir_manager.py @@ -11,11 +11,11 @@ class DirManager: The structures is as follows: tests dir/ session_id-1/ - records results states + status session_id-2/ - records + results ... """ @@ -32,7 +32,6 @@ class DirManager: dirs: list[Path] = [ self.OUTPUT_DIR, self.SESSION, - self.RECORDS, self.HTML, self.STATES, self.ENV_FILES, @@ -50,13 +49,9 @@ class DirManager: def SESSION(self): return self.OUTPUT_DIR / self.session_id - @property - def RECORDS(self): - return self.SESSION / "records" - @property def HTML(self): - return self.RECORDS / "html" + return self.RESULTS / "html" @property def STATES(self): diff --git a/pytest_abra/runner.py b/pytest_abra/runner.py index 055c7c1..251068a 100644 --- a/pytest_abra/runner.py +++ b/pytest_abra/runner.py @@ -158,7 +158,7 @@ class Runner: # --output only works with the given context and page fixture # folder needs to be unique! traces will not appear, if every pytest run has same output dir command_arguments.append("--output") - command_arguments.append(str(self.DIR.RECORDS / "traces" / full_test_path.stem)) + command_arguments.append(str(self.DIR.RESULTS / "traces" / full_test_path.stem)) # tracing command_arguments.append("--tracing") # "on", "off", "retain-on-failure" @@ -173,7 +173,7 @@ class Runner: # command_arguments.append("--headed") # html report. Will be combined into one file later. - command_arguments.append(f"--html={self.DIR.RECORDS / 'html' / full_test_path.with_suffix('.html').name}") + command_arguments.append(f"--html={self.DIR.RESULTS / 'html' / full_test_path.with_suffix('.html').name}") return pytest.main(command_arguments)