Skip to content

Commit 0e4b517

Browse files
Fix jq validation to work correctly under bash -e
Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
1 parent eb9e013 commit 0e4b517

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

.github/workflows/test-github-action.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,17 @@ jobs:
113113
dbt run --target snowflake || true
114114
115115
# Validate run_results.json: only error_model should be non-success
116-
jq -e '
116+
if jq -e '
117117
[.results[] | select(.status != "success") | .unique_id]
118118
| length == 1 and .[0] == "model.elementary_integration_tests.error_model"
119-
' target/run_results.json > /dev/null
120-
jq_exit=$?
121-
122-
if [ $jq_exit -eq 0 ]; then
119+
' target/run_results.json > /dev/null; then
123120
echo "Validation passed: only error_model failed."
124121
else
125122
echo "Validation failed. Unexpected failures:"
126123
jq '[.results[] | select(.status != "success") | .unique_id] | join(", ")' target/run_results.json
124+
exit 1
127125
fi
128126
129-
exit $jq_exit
130-
131127
- name: Test e2e dbt project
132128
working-directory: ${{ env.E2E_DBT_PROJECT_DIR }}
133129
continue-on-error: true

0 commit comments

Comments
 (0)