Skip to content

Commit

Permalink
Merge pull request #145 from usnistgov/124-test-add-CI-for-SST1RSoXS
Browse files Browse the repository at this point in the history
Add CI hooks for `SST1RSoXSDB` testing
  • Loading branch information
pbeaucage authored Sep 4, 2024
2 parents 08c3943 + dc0e85c commit 5c1662a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
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

0 comments on commit 5c1662a

Please sign in to comment.