Skip to content

Commit 1833cd6

Browse files
authored
Merge pull request #331 from effigies/test/update_ds003_tests
CI: Update ds003 tests
2 parents f6a5dd4 + 9596681 commit 1833cd6

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

.github/workflows/workflows.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,38 +107,37 @@ jobs:
107107
python -m pip install --upgrade pip
108108
pip install datalad==0.14.7
109109
110-
- name: WTF!?
110+
- name: Datalad WTF
111111
run: |
112112
datalad wtf
113113
114-
- name: "cached data"
114+
- name: Install cached data
115115
uses: actions/cache@v2
116116
id: cache
117117
with:
118118
path: /tmp/.cache/data
119-
key: ds003-v4-${{ runner.os }}-${{ github.job }}
119+
key: ds003-v5-${{ github.ref_name }}-${{ github.sha }}
120120
restore-keys: |
121-
ds003-v4-${{ runner.os }}-
122-
ds003-v4-
123-
ds003-
121+
ds003-v5-${{ github.ref_name }}-
122+
ds003-v5-
124123
125124
- name: "Install fMRIPrep derivatives of ds000003 and reference data"
126125
# if: steps.cache.outputs.cache-hit != 'true'
127126
run: |
128127
cd /tmp/.cache/data
129-
datalad install -r -s https://gin.g-node.org/shashankbansal56/fitlins_tests
130-
datalad update --merge -d fitlins_tests
131-
cd fitlins_tests
132-
datalad get ds003/fmriprep/sub-0{1,2,3}/func/*_space-MNI152NLin2009cAsym_desc-*.nii.gz \
133-
ds003/fmriprep/sub-0{1,2,3}/func/*_desc-confounds_*.tsv \
134-
ds003/fmriprep/dataset_description.json \
135-
ds003/fmriprep/sub-*/*/*.json
136-
datalad get -r ds003/nistats_smooth/ ds003/afni_smooth/ ds003/afni_blurto/ ds003/nistats_blurto/
128+
datalad install -r -s https://gin.g-node.org/markiewicz/fitlins-tests
129+
datalad update --merge -d fitlins-tests
130+
cd fitlins-tests
131+
datalad get inputs/ds000003-fmriprep/sub-0{1,2,3}/func/*_space-MNI152NLin2009cAsym_desc-*.nii.gz \
132+
inputs/ds000003-fmriprep/sub-0{1,2,3}/func/*_desc-confounds_*.tsv \
133+
inputs/ds000003-fmriprep/dataset_description.json \
134+
inputs/ds000003-fmriprep/sub-*/*/*.json \
135+
outputs
137136
datalad status
138137
139138
- name: "Check installed derivatives data"
140139
run: |
141-
cd /tmp/.cache/data/fitlins_tests/ds003
140+
cd /tmp/.cache/data/fitlins-tests/
142141
git log --oneline --graph
143142
du -sh .
144143
@@ -225,11 +224,7 @@ jobs:
225224
id: cache
226225
with:
227226
path: /tmp/.cache/data
228-
key: ds003-v4-${{ runner.os }}
229-
restore-keys: |
230-
ds003-v4-${{ runner.os }}
231-
ds003-v4-
232-
ds003-
227+
key: ds003-v5-${{ github.ref_name }}-${{ github.sha }}
233228

234229
- name: Run fitlins
235230
timeout-minutes: 240
@@ -240,7 +235,7 @@ jobs:
240235
chmod 777 /tmp/ds003/work /tmp/ds003/derivatives
241236
export CONDA_PREFIX=/opt/miniconda-latest/envs/neuro
242237
echo $CONDA_PREFIX
243-
docker run --rm -v /tmp/.cache/data/fitlins_tests:/data:ro \
238+
docker run --rm -v /tmp/.cache/data/fitlins-tests:/data:ro \
244239
-v /tmp/ds003/derivatives:/out \
245240
-v /tmp/ds003/work:/scratch \
246241
-v $GITHUB_WORKSPACE:/src/fitlins \
@@ -252,14 +247,14 @@ jobs:
252247
--cov-report xml:/scratch/.coverage_pytest_${{ matrix.test_name }}.xml \
253248
$CONDA_PREFIX/lib/python3.9/site-packages/fitlins/tests \
254249
--fitlins-path=$CONDA_PREFIX/bin/fitlins \
255-
--bids-dir=/data/ds003/fmriprep/sourcedata \
250+
--bids-dir=/data/inputs/ds000003 \
256251
--output-dir=/out \
257-
--derivatives=/data/ds003/fmriprep \
252+
--derivatives=/data/inputs/ds000003-fmriprep \
258253
--model=/src/fitlins/examples/models/ds000003/models/model-001_smdl.json \
259254
--work-dir=/scratch \
260255
--test-name=${{ matrix.test_name }} \
261256
--database-path=/out/ds003_database \
262-
--reference-dir=/data/ds003
257+
--reference-dir=/data/outputs/
263258
264259
- name: Combine coverage and submit
265260
uses: codecov/codecov-action@v2

fitlins/tests/test_outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_outputs(
130130

131131
# TODO: parameterize this
132132
reference_root = Path(reference_dir)
133-
reference_dir = reference_root / f'{test_name}/out/fitlins'
133+
reference_dir = reference_root / f'{test_name}/fitlins'
134134

135135
# check niftis against reference
136136
ref_niis = sorted(reference_dir.glob('**/*.nii.gz'))

0 commit comments

Comments
 (0)