Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI hooks for SST1RSoXSDB testing #145

Merged
merged 14 commits into from
Sep 4, 2024
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ jobs:
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
path: ${{ env.pythonLocation }}
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
Expand Down Expand Up @@ -76,6 +75,8 @@ jobs:
C:\msys64\usr\bin\wget.exe https://github.com/usnistgov/PyHyperScattering/releases/download/0.0.0-example-data/CMS_giwaxs_series.zip
unzip CMS_giwaxs_series.zip
- name: Test with pytest
env:
TILED_API_KEY: ${{ secrets.TILED_API_KEY }}
run: |
#pytest -v
#temporarily disabling coverage for memory usage
Expand Down
3 changes: 2 additions & 1 deletion requirements-bluesky.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tiled[client]>=0.1.0a74
tiled[all]>=0.1.0a74
databroker[all]>=2.0.0b10
bottleneck
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ astropy
fabio
h5py
nodejs
numpy
numpy<2
pandas
# pygix fails to improt if silx > 2.0.0
silx==2.0.0
Expand Down
14 changes: 9 additions & 5 deletions tests/test_SST1DBLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
SKIP_DB_TESTING=False
except tiled.profiles.ProfileNotFound:
try:
client = tiled.client.from_uri('https://tiled-demo.blueskyproject.io')
SKIP_DB_TESTING=True # waiting on test data to be posted to this server
import os
api_key = os.environ['TILED_API_KEY']
client = tiled.client.from_uri('https://tiled.nsls2.bnl.gov',api_key=api_key)
SKIP_DB_TESTING=False
except Exception:
SKIP_DB_TESTING=True
except ImportError:
Expand All @@ -32,10 +34,12 @@
@pytest.fixture(autouse=True,scope='module')
def sstdb():
try:
catalog = tiled.client.from_profile('rsoxs')
client = tiled.client.from_profile('rsoxs')
except tiled.profiles.ProfileNotFound:
catalog = tiled.client.from_uri('https://tiled-demo.blueskyproject.io')['rsoxs']['raw']
sstdb = SST1RSoXSDB(catalog=catalog,corr_mode='none')
import os
api_key = os.environ['TILED_API_KEY']
client = tiled.client.from_uri('https://tiled.nsls2.bnl.gov',api_key=api_key)['rsoxs']['raw']
sstdb = SST1RSoXSDB(catalog=client,corr_mode='none')
return sstdb

@must_have_tiled
Expand Down
Loading