-
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 #6 from Australian-Imaging-Service/develop
Debugging CLI (primarily env var) issues
- Loading branch information
Showing
7 changed files
with
168 additions
and
46 deletions.
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from click.testing import CliRunner | ||
from xnat_ingest.cli import stage | ||
from xnat_ingest.utils import show_cli_trace | ||
|
||
runner = CliRunner() | ||
|
||
|
||
result = runner.invoke( | ||
stage, | ||
[], | ||
env={ | ||
"XNAT_INGEST_STAGE_DICOMS_PATH": "/vol/vmhost/kubernetes/<path>/<to>/<dicom>/<store>/**/*.IMA", | ||
"XNAT_INGEST_STAGE_DIR": "/vol/vmhost/usyd-data-export/STAGING", | ||
"XNAT_INGEST_STAGE_PROJECT": "ProtocolName", | ||
"XNAT_INGEST_STAGE_SUBJECT": "PatientID", | ||
"XNAT_INGEST_STAGE_VISIT": "AccessionNumber", | ||
"XNAT_INGEST_STAGE_ASSOCIATED": '"/vol/vmhost/usyd-data-export/RAW-DATA-EXPORT/{PatientName.family_name}_{PatientName.given_name}/.ptd","./[^\\.]+.[^\\.]+.[^\\.]+.(?P\\d+).[A-Z]+_(?P[^\\.]+)."', | ||
"XNAT_INGEST_STAGE_DELETE": "0", | ||
"XNAT_INGEST_STAGE_LOGFILE": "<somewhere-sensible>,INFO", | ||
"XNAT_INGEST_STAGE_DEIDENTIFY": "1", | ||
}, | ||
catch_exceptions=False, | ||
) | ||
|
||
|
||
assert result.exit_code == 0, show_cli_trace(result) |
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,20 @@ | ||
import os | ||
from click.testing import CliRunner | ||
from xnat_ingest.cli import transfer | ||
from xnat_ingest.utils import show_cli_trace | ||
|
||
runner = CliRunner() | ||
|
||
|
||
result = runner.invoke( | ||
transfer, | ||
[], | ||
env={ | ||
"XNAT_INGEST_STAGE_DIR": "/Users/tclose/Data/testing/staging-test/", | ||
"XNAT_INGEST_TRANSFER_LOGFILE": "/Users/tclose/Desktop/test-log.log,INFO", | ||
"XNAT_INGEST_TRANSFER_DELETE": "0", | ||
}, | ||
catch_exceptions=False, | ||
) | ||
|
||
assert result.exit_code == 0, show_cli_trace(result) |
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,26 @@ | ||
from click.testing import CliRunner | ||
from xnat_ingest.cli import upload | ||
from xnat_ingest.utils import show_cli_trace | ||
|
||
runner = CliRunner() | ||
|
||
result = runner.invoke( | ||
upload, | ||
[], | ||
env={ | ||
"XNAT_INGEST_UPLOAD_STAGED": "<s3-bucket>", | ||
"XNAT_INGEST_UPLOAD_HOST": "https://xnat.sydney.edu.au", | ||
"XNAT_INGEST_UPLOAD_USER": "<role-account-user>", | ||
"XNAT_INGEST_UPLOAD_PASS": "<role-account-pass>", | ||
"XNAT_INGEST_UPLOAD_ALWAYSINCLUDE": "medimage/dicom-series", | ||
"XNAT_INGEST_UPLOAD_STORE_CREDENTIALS": "<s3-bucket-access-key>,<s3-bucket-access-secret>", | ||
"XNAT_INGEST_UPLOAD_LOGFILE": "<somewhere-sensible>,INFO", | ||
"XNAT_INGEST_UPLOAD_DELETE": "0", | ||
"XNAT_INGEST_UPLOAD_TEMPDIR": "<somewhere-else-sensible>", | ||
"XNAT_INGEST_UPLOAD_REQUIRE_MANIFEST": "1", | ||
"XNAT_INGEST_UPLOAD_CLEANUP_OLDER_THAN": "30", | ||
}, | ||
catch_exceptions=False, | ||
) | ||
|
||
assert result.exit_code == 0, show_cli_trace(result) |
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
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
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
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