forked from dbt-labs/dbt-external-tables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_test.sh
executable file
·40 lines (36 loc) · 1.13 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
#!/bin/bash
echo "Setting up virtual environment"
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
pip install pyodbc==4.0.32 # See https://github.com/dbt-labs/dbt-external-tables/issues/156
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
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"
dbt deps --target $1
dbt seed --full-refresh --target $1
dbt run-operation prep_external --target $1
dbt run-operation stage_external_sources --var 'ext_full_refresh: true' --target $1
dbt run-operation stage_external_sources --target $1
dbt test --target $1