forked from dbt-labs/dbt-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_test.sh
More file actions
executable file
·28 lines (22 loc) · 742 Bytes
/
run_test.sh
File metadata and controls
executable file
·28 lines (22 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Show location of local install of dbt
echo $(which dbt)
# Show version and installed adapters
dbt --version
# Set the profile
cd integration_tests
cp ci/sample.profiles.yml profiles.yml
export DBT_PROFILES_DIR=.
# Show the location of the profiles directory and test the connection
dbt debug --target $1
_models=""
_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 || 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 || exit 1
fi
dbt run -x --target $1 $_models || exit 1
dbt test -x --target $1 $_models || exit 1