From 8356233ba48ff6c58616ba20c1c26f3202423790 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Thu, 10 Oct 2024 06:58:54 +0000 Subject: [PATCH] Unhide pytest output by removing dotfile directory (#3631) Prior to this PR, output from pytest was generally hidden by placing it in the .pytest directory. After this PR, that .pytest directory is now pytest-parsl. Most immediately, a breaking change in the GitHub actions artifact upload has started respecting that dotfile hiddenness, and so with that version of the artifact uploader, test runs prior to this PR are missing a bunch of output. https://github.com/actions/upload-artifact/issues/602 The uploader now has an option to enable hidden files... but ... .. before this most immediate motivation, I've run into a couple of developer experience cases that look like: Q: I cannot find the output of pytest A: We have deliberately made it hard for you to find which is enough to make me rename the directory rather than turn on the artifact uploader hidden files option. --- .github/workflows/ci.yaml | 10 +++++----- .gitignore | 1 + parsl/tests/conftest.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a686b8649..e5247c5d25 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,7 +60,7 @@ jobs: export PARSL_TEST_PRESERVE_NUM_RUNS=7 make test - ln -s .pytest/parsltest-current test_runinfo + ln -s pytest-parsl/parsltest-current test_runinfo - name: Documentation checks run: | @@ -80,11 +80,11 @@ jobs: # database manager log file or monitoring router log file. It would be better if # the tests themselves failed immediately when there was a monitoring error, but # in the absence of that, this is a dirty way to check. - bash -c '! grep ERROR .pytest/parsltest-current/runinfo*/*/database_manager.log' - bash -c '! grep ERROR .pytest/parsltest-current/runinfo*/*/monitoring_router.log' + bash -c '! grep ERROR pytest-parsl/parsltest-current/runinfo*/*/database_manager.log' + bash -c '! grep ERROR pytest-parsl/parsltest-current/runinfo*/*/monitoring_router.log' # temporary; until test-matrixification - rm -f .pytest/parsltest-current test_runinfo + rm -f pytest-parsl/parsltest-current test_runinfo - name: Checking parsl-visualize run: | @@ -105,6 +105,6 @@ jobs: name: runinfo-${{ matrix.python-version }}-${{ steps.job-info.outputs.as-ascii }}-${{ github.sha }} path: | runinfo/ - .pytest/ + pytest-parsl/ ci_job_info.txt compression-level: 9 diff --git a/.gitignore b/.gitignore index acdb6254d1..8811016b83 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ coverage.xml *.cover .hypothesis/ /.pytest/ +/pytest-parsl/ # Translations *.mo diff --git a/parsl/tests/conftest.py b/parsl/tests/conftest.py index 638088c44c..b8af73e4bf 100644 --- a/parsl/tests/conftest.py +++ b/parsl/tests/conftest.py @@ -58,7 +58,7 @@ def _chmod(path: pathlib.Path, mode: int): config = re.sub(r"[^A-z0-9_-]+", "_", pytestconfig.getoption('config')[0]) cwd = pathlib.Path(os.getcwd()) - pytest_dir = cwd / ".pytest" + pytest_dir = cwd / "pytest-parsl" pytest_dir.mkdir(mode=0o700, parents=True, exist_ok=True) test_dir_prefix = "parsltest-"