Skip to content

Commit

Permalink
Segragate dbt versions to test by target
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio Diniz committed Mar 18, 2023
1 parent 7682bf8 commit d1ead7d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
6 changes: 4 additions & 2 deletions run-all-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ fi

PROFILE="$1"

./run-tests-on-dbt-version.sh "run-integration-tests" "$PROFILE" "1.3.3"
./run-tests-on-dbt-version.sh "run-integration-tests" "$PROFILE" "1.4.5"
# Source the script that contains the run_tests function and versions
source ./run-tests-helper.sh

run_tests "run-integration-tests" "$PROFILE"
8 changes: 6 additions & 2 deletions run-all-jaffle-shop-tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash

set -e

if [ -z "$1" ]; then
echo 'Please provide profile name'
exit 1
fi

PROFILE="$1"

./run-tests-on-dbt-version.sh "run-jaffle-shop-tests" "$PROFILE" "1.3.3"
./run-tests-on-dbt-version.sh "run-jaffle-shop-tests" "$PROFILE" "1.4.0"
# Source the script that contains the run_tests function and versions
source ./run-tests-helper.sh

run_tests "run-jaffle-shop-tests" "$PROFILE"
37 changes: 37 additions & 0 deletions run-tests-helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

function run_tests() {
local TEST_SUITE=$1
local PROFILE=$2

if [ "$PROFILE" == "postgres" ]; then
VERSIONS="1.3.3 1.4.0"
elif [ "$PROFILE" == "bigquery" ]; then
VERSIONS="1.3.2"
elif [ "$PROFILE" == "snowflake" ]; then
VERSIONS="1.3.1"
else
echo "Invalid profile name: $PROFILE"
exit 1
fi

if [ -z "$TEST_SUITE" ]; then
echo 'Please provide test suite name'
exit 1
fi

if [ -z "$PROFILE" ]; then
echo 'Please provide profile name'
exit 1
fi

if [ -z "$VERSIONS" ]; then
echo 'Please provide versions to test'
exit 1
fi

for DBT_VERSION in $VERSIONS; do
echo $DBT_VERSION
./run-tests-on-dbt-version.sh "$TEST_SUITE" "$PROFILE" "$DBT_VERSION"
done
}

0 comments on commit d1ead7d

Please sign in to comment.