From 5b574c876437337d294095aa7a86bb6320d84370 Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Fri, 16 Feb 2024 17:52:36 -0500 Subject: [PATCH] use github environment variables Signed-off-by: Jose Borreguero --- .github/workflows/actions.yml | 2 ++ reduction/test/conftest.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 915d89d..cc1125e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -24,6 +24,8 @@ jobs: - name: Test with pytest working-directory: ./reduction run: | + echo datasearch.directories=${{ github.workspace }}/reduction/tests/data/liquidsreflectometer-data/nexus/ >> ${{ runner.home }}/.mantid/Mantid.user.properties + cat ${{ runner.home }}/.mantid/Mantid.user.properties git submodule add --force https://code.ornl.gov/sns-hfir-scse/infrastructure/test-data/liquidsreflectometer-data.git tests/data/liquidsreflectometer-data git submodule update --init python -m pytest -vv --cov=. --cov-report=xml --cov-report=term test diff --git a/reduction/test/conftest.py b/reduction/test/conftest.py index e50487a..430382e 100644 --- a/reduction/test/conftest.py +++ b/reduction/test/conftest.py @@ -3,9 +3,7 @@ from pathlib import Path import os -data_dir = Path(__file__).parent.parent / "data" - - +''' def pytest_sessionstart(session): r"""invoked by pytest at the very beginning""" logger = logging.getLogger() @@ -15,6 +13,7 @@ def pytest_sessionstart(session): mantid_config_file = mantid_config_dir / "Mantid.user.properties" write_mode = "a" if mantid_config_file.exists() else "w" # append or create-then-write with open(mantid_config_file, write_mode) as file_handle: - data_path = data_dir / "liquidsreflectometer-data" / "nexus" + data_path = Path(__file__).parent.parent / "tests/data/liquidsreflectometer-data/nexus" file_handle.write(f"datasearch.directories={str(data_path)}") logger.info("Appending data directory to mantid config file") +''' \ No newline at end of file