From 7a585b9f105acf490873fa19a77f008383c340fd Mon Sep 17 00:00:00 2001 From: wasserth Date: Tue, 24 Oct 2023 11:12:28 +0200 Subject: [PATCH] properly handle exit codes in test script --- tests/tests.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/tests.sh b/tests/tests.sh index 82086b189..358f0447f 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -1,3 +1,5 @@ +set -e + # To run these tests simply do # ./tests.sh @@ -39,11 +41,12 @@ TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest pytest -v tests/test_end_to_end.py::test_end_to_end::test_lung_vessels # Test tissue types (without license) -TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_no_license.nii.gz -ta tissue_types -d cpu --ml +# (use "|| true" to not abort if this command returns exit code 1, which it should do) +TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_no_license.nii.gz -ta tissue_types -d cpu --ml || true pytest -v tests/test_end_to_end.py::test_end_to_end::test_tissue_types_wo_license # Test tissue types (wrong license) -TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_wrong_license.nii.gz -ta tissue_types -d cpu --ml -l aca_123456789 +TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_wrong_license.nii.gz -ta tissue_types -d cpu --ml -l aca_123456789 || true pytest -v tests/test_end_to_end.py::test_end_to_end::test_tissue_types_wrong_license # Test tissue types (with license)