Skip to content

Commit

Permalink
define log path
Browse files Browse the repository at this point in the history
  • Loading branch information
hussain-jafari committed Jan 22, 2025
1 parent e313609 commit 9f93c13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 1 addition & 5 deletions tests/integration/release/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,9 @@ def pytest_addoption(parser: pytest.Parser) -> None:
############
@pytest.fixture(scope="session")
def release_output_dir() -> Path:
# TODO: [MIC-5522] define correct output dir
# output_dir = os.environ.get("PSP_TEST_OUTPUT_DIR")
output_dir_name = (
"/mnt/team/simulation_science/priv/engineering/pseudopeople_release_testing"
"/mnt/team/simulation_science/priv/engineering/pseudopeople_release_testing"
)
# if not output_dir_name:
# raise ValueError("PSP_TEST_OUTPUT_DIR environment variable not set")
output_dir = Path(output_dir_name) / f"{time.strftime('%Y%m%d_%H%M%S')}"
output_dir.mkdir(parents=True, exist_ok=False)
return output_dir.resolve()
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/release/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
# (["--dataset", "wic", "--population", "USA", "--state", "RI", "--year", "2015"]),
],
)
def test_release_tests(pytest_args: list[str]) -> None:
def test_release_tests(pytest_args: list[str], release_output_dir: Path) -> None:
os.chdir(Path(__file__).parent) # need this to access cli options from conftest.py
base_cmd = ["pytest", "--release", "test_release.py"]
cmd = base_cmd + pytest_args
result = subprocess.run(cmd, capture_output=True, text=True)
assert result.returncode == 0
# Open a file in write mode
with open(f"{release_output_dir}/pytest.new", 'w') as log_file:
# Run pytest and direct stdout to the log file
subprocess.run(cmd, stdout=log_file)


@pytest.mark.parametrize("dataset", ["acs", "cps"])
Expand Down

0 comments on commit 9f93c13

Please sign in to comment.