diff --git a/.github/workflows/wipac-cicd.yaml b/.github/workflows/wipac-cicd.yaml index 251844a..31f21c0 100644 --- a/.github/workflows/wipac-cicd.yaml +++ b/.github/workflows/wipac-cicd.yaml @@ -136,7 +136,7 @@ jobs: uses: actions/setup-python@v4 - name: Create a mock dataset structure run: | - set -e + set -euo pipefail job_range_dpaths=( /tmp/data/sim/{IceCube,Upgrade}/{2022,2023}/{generated,filtered}/{CORSIKA,neutrino-generator}/{77777,88888,99999}/{00-11,22-33,44-55} ) @@ -154,20 +154,23 @@ jobs: - name: Run script with matrix parameters run: | - set -e + set -euo pipefail echo "Testing with base_path=${{ matrix.base_path }}, num_datasets=${{ matrix.num_datasets }}" ./resources/sample-each-dataset.sh ${{ matrix.base_path }} 0.5 ${{ matrix.num_datasets }} - name: Validate script execution run: | - set -e + set -euo pipefail # Check if the expected number of datasets are processed processed_count=$(find ${{ matrix.base_path }} -name '*.histo.hdf5' | wc -l) - if [[ $processed_count -lt ${{ matrix.num_datasets }}} ]]; then + echo "Processed count: $processed_count" + echo "Expected count: ${{ matrix.num_datasets }}" + if [[ $processed_count -lt ${{ matrix.num_datasets }} ]]; then echo "Script did not process the expected number of datasets!" exit 1 fi echo "All tests passed." + ########################################################################### # RELEASE diff --git a/resources/cp-src-histos-tree.sh b/resources/cp-src-histos-tree.sh index 16295c2..c073a09 100755 --- a/resources/cp-src-histos-tree.sh +++ b/resources/cp-src-histos-tree.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail ######################################################################################## # Script Name: Simprod Histogram Sampler diff --git a/resources/sample-each-dataset.sh b/resources/sample-each-dataset.sh index e146932..9af47af 100755 --- a/resources/sample-each-dataset.sh +++ b/resources/sample-each-dataset.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail ####################################################################################### # This script automates the sampling of histograms from dataset directories. It takes