-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (91 loc) · 2.98 KB
/
test_integration_adapter.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: dbt-fal integration tests
on:
pull_request:
types: [assigned, opened, synchronize, reopened]
paths:
- "projects/adapter/**"
- ".github/workflows/test_integration_adapter.yml"
push:
branches: [main]
paths:
- "projects/adapter/**"
schedule:
# every monday
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
profile:
- postgres
dbt_version:
- "1.7.16"
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
concurrency:
group: "${{ github.head_ref || github.run_id }}-${{ github.workflow }}-${{ matrix.profile }}-${{ matrix.python }}"
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
path: "fal"
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Start Docker database
working-directory: fal/projects/adapter/integration_tests
if: contains(fromJSON('["postgres"]'), matrix.profile)
run: docker-compose up -d
- name: Setup latest dependencies
working-directory: fal/projects/adapter/integration_tests
run: |
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
ADAPTER_PACKAGE="dbt-${{ matrix.profile }}"
if [[ -n '${{ matrix.dbt_version }}' ]]
then
ADAPTER_PACKAGE="${ADAPTER_PACKAGE}==${{ matrix.dbt_version }}"
fi
pushd ..
EXTRAS="${{ matrix.profile }}"
if [[ '${{ matrix.teleport }}' == 'true' ]]
then
EXTRAS="$EXTRAS,teleport"
fi
DBT_FAL_PACKAGE=".[$EXTRAS]"
echo "pip install $ADAPTER_PACKAGE -e $DBT_FAL_PACKAGE"
pip install $ADAPTER_PACKAGE -e $DBT_FAL_PACKAGE
popd
- name: Setup behave
working-directory: fal/projects/adapter/integration_tests
run: pip install behave
- name: Run tests
id: test_run
working-directory: fal/projects/adapter/integration_tests
env:
FAL_STATS_ENABLED: false
run: |
source .venv/bin/activate
# Database and schema setup for sources
# Could not get the real job_id easily from context
UUID=$(uuidgen | head -c8)
export DB_NAMESPACE="${{ github.run_id }}_${UUID}"
BEHAVE_TAGS="--tags=-TODO-${{ matrix.profile }}"
if [[ '${{ matrix.teleport }}' != 'true' ]]
then
BEHAVE_TAGS="$BEHAVE_TAGS --tags=-teleport"
fi
if [[ -z "${GITHUB_HEAD_REF}" ]]
then
export FAL_GITHUB_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
else
export FAL_GITHUB_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
fi
behave $BEHAVE_TAGS -fplain -D profile=${{ matrix.profile }} --no-capture