Skip to content

Commit

Permalink
[TST] Expands integration (#482)
Browse files Browse the repository at this point in the history
* Expands integration testing to include mapca and several of its options
  • Loading branch information
jbteves authored Dec 11, 2019
1 parent 9912c09 commit 2e6e3cb
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,31 @@ jobs:
root: /tmp
paths:
- src/coverage/.coverage.three-echo

four-echo:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/tedana
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
- run:
name: Run integration tests
no_output_timeout: 40m
command: |
apt-get install -yqq make
source activate tedana_py37 # depends on makeenv_37
make four-echo
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.four-echo
- store_artifacts:
path: /tmp/data
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.four-echo

five-echo:
docker:
- image: continuumio/miniconda3
Expand Down Expand Up @@ -216,6 +241,9 @@ workflows:
- three-echo:
requires:
- makeenv_37
- four-echo:
requires:
- makeenv_37
- five-echo:
requires:
- makeenv_37
Expand All @@ -225,4 +253,5 @@ workflows:
- unittest_36
- unittest_37
- three-echo
- four-echo
- five-echo
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ unittest:
three-echo:
@py.test --cov-append --cov-report term-missing --cov=tedana -k test_integration_three_echo tedana/tests/test_integration.py

four-echo:
@py.test --cov-append --cov-report term-missing --cov=tedana -k test_integration_four_echo tedana/tests/test_integration.py

five-echo:
@py.test --cov-append --cov-report term-missing --cov=tedana -k test_integration_five_echo tedana/tests/test_integration.py

9 changes: 9 additions & 0 deletions dev_tools/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ run_three_echo_test() {
cprint "THREE-ECHO TEST PASSED !"
}

run_four_echo_test() {
#
# Runs tedana four-echo test
cprint "RUNNING four-ECHO TEST"
make four-echo
cprint "FOUR-ECHO TEST PASSED !"
}

run_five_echo_test() {
#
# Runs tedana five-echo test
Expand Down Expand Up @@ -66,6 +74,7 @@ run_all_tests() {
run_lint_tests
run_unit_tests
run_three_echo_test
run_four_echo_test
run_five_echo_test

cprint "FINISHED RUNNING ALL TESTS -- GREAT SUCCESS !"
Expand Down
File renamed without changes.
66 changes: 66 additions & 0 deletions tedana/tests/data/fiu_four_echo_outputs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
adaptive_mask.nii.gz
betas_OC.nii.gz
betas_hik_OC.nii.gz
dn_ts_OC.nii.gz
feats_OC2.nii.gz
figures
hik_ts_OC.nii.gz
ica_components.nii.gz
ica_decomposition.json
ica_mixing.tsv
ica_orth_mixing.tsv
lowk_ts_OC.nii.gz
pca_components.nii.gz
pca_decomposition.json
pca_mixing.tsv
report.txt
s0v.nii.gz
t2sv.nii.gz
ts_OC.nii.gz
figures/Component_Overview.png
figures/Kappa_vs_Rho_Scatter.png
figures/comp_000.png
figures/comp_001.png
figures/comp_002.png
figures/comp_003.png
figures/comp_004.png
figures/comp_005.png
figures/comp_006.png
figures/comp_007.png
figures/comp_008.png
figures/comp_009.png
figures/comp_010.png
figures/comp_011.png
figures/comp_012.png
figures/comp_013.png
figures/comp_014.png
figures/comp_015.png
figures/comp_016.png
figures/comp_017.png
figures/comp_018.png
figures/comp_019.png
figures/comp_020.png
figures/comp_021.png
figures/comp_022.png
figures/comp_023.png
figures/comp_024.png
figures/comp_025.png
figures/comp_026.png
figures/comp_027.png
figures/comp_028.png
figures/comp_029.png
figures/comp_030.png
figures/comp_031.png
figures/comp_032.png
figures/comp_033.png
figures/comp_034.png
figures/comp_035.png
figures/comp_036.png
figures/comp_037.png
figures/comp_038.png
figures/comp_039.png
figures/comp_040.png
figures/comp_041.png
figures/comp_042.png
figures/comp_043.png
figures/comp_044.png
36 changes: 34 additions & 2 deletions tedana/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,37 @@ def test_integration_five_echo(skip_integration):
assert isinstance(df, pd.DataFrame)

# compare the generated output files
fn = resource_filename('tedana', 'tests/data/tedana_outputs_verbose.txt')
fn = resource_filename('tedana',
'tests/data/nih_five_echo_outputs_verbose.txt')
check_integration_outputs(fn, out_dir)


def test_integration_four_echo(skip_integration):
""" Integration test of the full tedana workflow using four-echo test data
"""

if skip_integration:
pytest.skip('Skipping four-echo integration test')
out_dir = '/tmp/data/four-echo/TED.four-echo'
if os.path.exists(out_dir):
shutil.rmtree(out_dir)

# download data and run the test
download_test_data('https://osf.io/gnj73/download',
os.path.dirname(out_dir))
prepend = '/tmp/data/four-echo/'
prepend += 'sub-PILOT_ses-01_task-localizerDetection_run-01_echo-'
suffix = '_space-sbref_desc-preproc_bold+orig.HEAD'
datalist = [prepend + str(i + 1) + suffix for i in range(4)]
tedana_workflow(data=datalist,
tes=[11.8, 28.04, 44.28, 60.52],
out_dir=out_dir,
tedpca='aic',
fittype='curvefit',
tedort=True)

# compare the generated output files
fn = resource_filename('tedana', 'tests/data/fiu_four_echo_outputs.txt')
check_integration_outputs(fn, out_dir)


Expand All @@ -120,8 +150,10 @@ def test_integration_three_echo(skip_integration):
data='/tmp/data/three-echo/three_echo_Cornell_zcat.nii.gz',
tes=[14.5, 38.5, 62.5],
out_dir=out_dir,
low_mem=True,
tedpca='kundu')

# compare the generated output files
fn = resource_filename('tedana', 'tests/data/tedana_outputs.txt')
fn = resource_filename('tedana',
'tests/data/cornell_three_echo_outputs.txt')
check_integration_outputs(fn, out_dir)

0 comments on commit 2e6e3cb

Please sign in to comment.