File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -132,16 +132,17 @@ jobs:
132132
133133 - name : Validate test results
134134 run : |
135- if [[ ! -n "$(find . -name 'test_report_*' -print -quit)" ]]; then
135+ mapfile -t test_reports < <(find . -name 'test_report_*.json')
136+ if [[ ${#test_reports[@]} -eq 0 ]]; then
136137 echo "No test results found"
137138 exit 0
138139 fi
139140
140- for json_report in *-test-results/test_report_*
141+ for json_report in "${test_reports[@]}"
141142 do
142- jq --raw-output '"PASS \(map(select(.pass == true)) | length)/\(length)'" $json_report\"" "$json_report"
143+ jq --raw-output '"PASS \(map(select(.pass == true)) | length)/\(length)"' "$json_report"
143144 done
144- FAILING_TESTS=$(jq --raw-output '.[] | select(.pass == false)' *-test-results/test_report_*.json )
145+ FAILING_TESTS=$(jq --raw-output '.[] | select(.pass == false)' "${test_reports[@]}" )
145146 if [[ ! -z "$FAILING_TESTS" ]]; then
146147 echo "ERROR: The following tests failed:"
147148 echo $FAILING_TESTS | jq .
You can’t perform that action at this time.
0 commit comments