forked from dbt-labs/dbt-external-tables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_test.sh
executable file
·43 lines (38 loc) · 1.25 KB
/
run_test.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
echo "Setting up virtual environment for dbt-$1"
VENV="venv/bin/activate"
if [[ ! -f $VENV ]]; then
python3.8 -m venv venv
. $VENV
pip install --upgrade pip setuptools
if [ $1 == 'databricks' ]
then
echo "Installing dbt-spark"
pip install dbt-spark[ODBC] --upgrade --pre
elif [ $1 == 'azuresql' ]
then
echo "Installing dbt-sqlserver"
pip install dbt-sqlserver --upgrade --pre
else
echo "Installing dbt-$1"
pip install dbt-$1 --upgrade --pre
# remove the protobuf installation when all the dbt-provider packaged are updated with dbt core 1.7.9
pip install protobuf==4.25.3
fi
fi
. $VENV
echo "Changing working directory: integration_tests"
cd integration_tests
if [[ ! -e ~/.dbt/profiles.yml ]]; then
echo "Copying sample profile"
mkdir -p ~/.dbt
cp ci/sample.profiles.yml ~/.dbt/profiles.yml
fi
echo "Starting integration tests"
set -eo pipefail
dbt deps --target $1
dbt seed --full-refresh --target $1
dbt run-operation prep_external --target $1
dbt run-operation dbt_external_tables.stage_external_sources --vars 'ext_full_refresh: true' --target $1
dbt run-operation dbt_external_tables.stage_external_sources --target $1
dbt test --target $1