-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from DCAN-Labs/test
Implementing pytest
- Loading branch information
Showing
5 changed files
with
190 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/temp/ | ||
/src/__pycache__/ | ||
/test-param-jsons/ | ||
/__pycache__ | ||
/__pycache__/ | ||
/.pytest_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{ | ||
"cabinet": { | ||
"container_type": "singularity", | ||
"stages": ["bibsnet", "solve_world_hunger", "nibabies"], | ||
"verbose": true, | ||
"handle_missing_host_paths": "make_directories" | ||
}, | ||
|
||
"stages": { | ||
"bibsnet": { | ||
"container_filepath": "/home/faird/shared/code/internal/pipelines/cabinet_container/cabinet_v2.4.3.sif", | ||
"container_args": { | ||
"--cleanenv": true, | ||
"--nv": true | ||
}, | ||
"binds": [ | ||
{ | ||
"host_path":"/home/faird/shared/data/BCP-MVP_BIBSNet/input/", | ||
"container_path":"/input" | ||
}, | ||
{ | ||
"host_path":"/home/feczk001/shared/projects/segpipeline_testing/Barry_test/cbaw-test/derivatives/" | ||
}, | ||
{ | ||
"host_path":"/home/feczk001/shared/projects/segpipeline_testing/Barry_test/cbaw-test/work/", | ||
"container_path":"/work" | ||
} | ||
], | ||
"positional_args": [ | ||
"/input", "/output", "participant" | ||
], | ||
"flags": { | ||
"--parameter-json":"/home/cabinet/parameter-file-container.json", | ||
"-start":"prebibsnet", | ||
"-end":"postbibsnet", | ||
"-v": true, | ||
"--participant-label":"470437", | ||
"-w":"/work" | ||
} | ||
}, | ||
"nibabies": { | ||
"container_filepath": "/home/faird/shared/code/external/pipelines/nibabies/nibabies_t1-t2-derivatives_08102023.sif", | ||
"container_args": { | ||
"--cleanenv": true | ||
}, | ||
"binds": [ | ||
{ | ||
"host_path":"/home/faird/shared/data/BCP-MVP_BIBSNet/input/", | ||
"container_path":"/bids_dir" | ||
}, | ||
{ | ||
"host_path":"/home/feczk001/shared/projects/segpipeline_testing/Barry_test/cbaw-test/derivatives/nibabies/", | ||
"container_path":"/output_dir" | ||
}, | ||
{ | ||
"host_path":"/home/feczk001/shared/projects/segpipeline_testing/Barry_test/cbaw-test/work/", | ||
"container_path":"/work" | ||
}, | ||
{ | ||
"host_path":"/home/faird/shared/code/external/utilities/freesurfer_license/license.txt", | ||
"container_path":"/opt/freesurfer/license.txt" | ||
}, | ||
{ | ||
"host_path":"/home/feczk001/shared/projects/segpipeline_testing/Barry_test/cbaw-test/derivatives/bibsnet/", | ||
"container_path":"/derivatives" | ||
}, | ||
{ | ||
"host_path":"/home/faird/tikal004/fake/file/path/", | ||
"container_path":"/fake_path" | ||
} | ||
], | ||
"positional_args": [ | ||
"/bids_dir", "/output_dir", "participant" | ||
], | ||
"flags": { | ||
"--project-goodvoxels": true, | ||
"--surface-recon-method": "mcribs", | ||
"--omp-nthreads": 3, | ||
"--resource-monitor": true, | ||
"--cifti-output": "91k", | ||
"-vv": true, | ||
"-w": "/work", | ||
"--fd-radius": 35, | ||
"--derivatives": "/derivatives", | ||
"--age-months": 1, | ||
"--participant-label":"470437" | ||
} | ||
}, | ||
"xcpd": { | ||
"container_args": { | ||
"--cleanenv": true | ||
}, | ||
"binds": [ | ||
{ | ||
"host_path":"/home/feczk001/shared/projects/segpipeline_testing/Barry_test/cbaw-test/work/", | ||
"container_path":"/work" | ||
}, | ||
{ | ||
"host_path":"/home/faird/shared/code/external/utilities/freesurfer_license/license.txt", | ||
"container_path":"/opt/freesurfer/license.txt" | ||
}, | ||
{ | ||
"host_path":"/home/feczk001/shared/projects/segpipeline_testing/Barry_test/cbaw-test/derivatives/", | ||
"container_path":"/output_dir" | ||
}, | ||
{ | ||
"host_path":"/home/faird/shared/code/external/pipelines/xcp_d_test_binds/20230712_fix-collection/xcp_d/xcp_d", | ||
"container_path":"/usr/local/miniconda/lib/python3.8/site-packages/xcp_d" | ||
} | ||
], | ||
"positional_args": [ | ||
"/output_dir/nibabies", "/output_dir/", "participant" | ||
], | ||
"flags": { | ||
"--input-type": "nibabies", | ||
"--cifti": true, | ||
"--despike":true, | ||
"--resource-monitor": true, | ||
"--dcan-qc": true, | ||
"-w": "/work", | ||
"--omp-nthreads": 3, | ||
"--warp-surfaces-native2std": true, | ||
"-f": 0.3, | ||
"-m": true, | ||
"-vv": true, | ||
"--participant-label": "470437" | ||
} | ||
}, | ||
"lolcow": { | ||
"container_filepath": "/home/faird/tikal004/lolcow.sif", | ||
"action": "exe", | ||
"positional_args": [ | ||
"cowsay", "\"Thank you for testing CABINET\"" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"cabinet": { | ||
"container_type": "singularity", | ||
"stages": ["lolcow", "dockerfail", "lolcow", "lolcow-exec"] | ||
}, | ||
|
||
"stages": { | ||
"lolcow": { | ||
"container_filepath": "/home/faird/shared/code/internal/utilities/test_containers/lolcow.sif" | ||
}, | ||
"dockerfail": { | ||
"container_filepath": "/home/faird/shared/code/internal/utilities/test_containers/dockerfail.sif" | ||
}, | ||
"lolcow-exec": { | ||
"action": "exec", | ||
"container_filepath": "/home/faird/shared/code/internal/utilities/test_containers/lolcow.sif", | ||
"positional_args": [ | ||
"cowsay", "Thank you for testing CABINET" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
# coding: utf-8 | ||
|
||
from src.valid_jargs_class import ValidJargs | ||
from src.wrapper_class import Wrapper | ||
|
||
param_json = "lolcow_test.json" | ||
|
||
Jargs = ValidJargs(param_json) | ||
|
||
Test = Wrapper(Jargs) | ||
|
||
def test_run_stage_pass(): | ||
|
||
assert Test.run_stage("lolcow") | ||
|
||
def test_run_stage_fail(): | ||
|
||
assert not Test.run_stage("dockerfail") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
# coding: utf-8 | ||
|
||
from src.valid_jargs_class import ValidJargs | ||
|
||
param_json = "invalid-example.json" | ||
|
||
Jargs = ValidJargs(param_json) | ||
|
||
assert not Jargs.validate_cabinet_options() |