Skip to content

Commit 9670513

Browse files
authored
TST: Update test to reflect new report generation behavior (#3210)
TST: Update test to reflect new report generation behavior
2 parents 7032782 + 6fb9f17 commit 9670513

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

.circleci/config.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -662,27 +662,6 @@ jobs:
662662
--output-spaces MNI152NLin2009cAsym:res-2 anat func \
663663
--mem-mb 14336 --nthreads 4 -vv --debug compcor
664664
- run: *check_outputs
665-
- run:
666-
name: Generate report with one artificial error
667-
command: |
668-
set -x
669-
sudo mv /tmp/${DATASET}/fmriprep/sub-100185.html \
670-
/tmp/${DATASET}/fmriprep/sub-100185_noerror.html
671-
UUID=$(grep uuid /tmp/${DATASET}/work/*/config.toml | cut -d\" -f 2 | tail -n 1)
672-
mkdir -p /tmp/${DATASET}/fmriprep/sub-100185/log/$UUID/
673-
cp /tmp/src/fmriprep/fmriprep/data/tests/crash_files/*.txt \
674-
/tmp/${DATASET}/fmriprep/sub-100185/log/$UUID/
675-
set +e
676-
fmriprep-docker -i nipreps/fmriprep:latest \
677-
-e FMRIPREP_DEV 1 --user $(id -u):$(id -g) \
678-
--config $PWD/nipype.cfg -w /tmp/${DATASET}/work \
679-
/tmp/data/${DATASET} /tmp/${DATASET}/fmriprep participant \
680-
--fs-no-reconall --sloppy --write-graph \
681-
--output-spaces MNI152NLin2009cAsym:res-2 anat func \
682-
--reports-only --config-file /tmp/${DATASET}/work/${UUID}/config.toml -vv
683-
RET=$?
684-
set -e
685-
[[ "$RET" -eq "1" ]]
686665
- run:
687666
name: Clean working directory
688667
when: on_success

fmriprep/cli/run.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,14 @@ def main():
224224
write_bidsignore(config.execution.fmriprep_dir)
225225

226226
if failed_reports:
227-
config.loggers.cli.error(
228-
"Report generation was not successful for the following participants : %s.",
229-
", ".join(failed_reports),
227+
msg = (
228+
'Report generation was not successful for the following participants '
229+
f': {", ".join(failed_reports)}.'
230230
)
231+
config.loggers.cli.error(msg)
232+
if sentry_sdk is not None:
233+
sentry_sdk.capture_message(msg, level="error")
231234

232-
if sentry_sdk is not None and failed_reports:
233-
sentry_sdk.capture_message(
234-
"Report generation was not successful for the following participants : %s.",
235-
", ".join(failed_reports),
236-
level="error",
237-
)
238235
sys.exit(int((errno + len(failed_reports)) > 0))
239236

240237

0 commit comments

Comments
 (0)