Skip to content

Commit

Permalink
use github environment variables
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Borreguero <[email protected]>
  • Loading branch information
jmborr committed Feb 16, 2024
1 parent 38b1baf commit 5b574c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions reduction/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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")
'''

0 comments on commit 5b574c8

Please sign in to comment.