Skip to content

Commit a619613

Browse files
committed
feat: make CI output directory configurable
Allow to change the output directory of the CI run with --json-report-file option Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent 05c2042 commit a619613

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def io_engine(request):
389389

390390

391391
@pytest.fixture
392-
def results_dir(request):
392+
def results_dir(request, pytestconfig):
393393
"""
394394
Fixture yielding the path to a directory into which the test can dump its results
395395
@@ -411,9 +411,9 @@ def test_my_file(p, results_dir):
411411
during doc tests, it will return None.
412412
"""
413413
try:
414-
results_dir = (
415-
defs.TEST_RESULTS_DIR / request.node.originalname / request.node.name
416-
)
414+
report_file = pytestconfig.getoption("--json-report-file")
415+
parent = Path(report_file).parent.absolute()
416+
results_dir = parent / request.node.originalname / request.node.name
417417
except AttributeError:
418418
return None
419419
results_dir.mkdir(parents=True, exist_ok=True)

tests/framework/defs.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
# Default test session artifacts path
2424
LOCAL_BUILD_PATH = FC_WORKSPACE_DIR / "build/"
2525

26-
# Absolute path to the test results folder
27-
TEST_RESULTS_DIR = FC_WORKSPACE_DIR / "test_results"
28-
2926
DEFAULT_BINARY_DIR = (
3027
LOCAL_BUILD_PATH
3128
/ "cargo_target"

0 commit comments

Comments
 (0)