From ed48deb93f61bc22f29c57889031978635fe5a02 Mon Sep 17 00:00:00 2001 From: Doug Beatty Date: Tue, 12 Apr 2022 15:15:12 -0600 Subject: [PATCH] Exit the integration test script with a non-zero exit code if any dbt command fails --- run_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/run_test.sh b/run_test.sh index 6f630e94..4cd758e8 100755 --- a/run_test.sh +++ b/run_test.sh @@ -22,10 +22,10 @@ _seeds="--full-refresh" if [[ ! -z $2 ]]; then _models="--models $2"; fi if [[ ! -z $3 ]]; then _seeds="--select $3 --full-refresh"; fi -dbt deps --target $1 -dbt seed --target $1 $_seeds +dbt deps --target $1 || exit 1 +dbt seed --target $1 $_seeds || exit 1 if [ $1 == 'redshift' ]; then - dbt run -x -m test_insert_by_period --full-refresh --target redshift + dbt run -x -m test_insert_by_period --full-refresh --target redshift || exit 1 fi -dbt run -x --target $1 $_models -dbt test -x --target $1 $_models +dbt run -x --target $1 $_models || exit 1 +dbt test -x --target $1 $_models || exit 1