-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathintegration-tests-sqlserver.yml
More file actions
186 lines (177 loc) · 6.7 KB
/
Copy pathintegration-tests-sqlserver.yml
File metadata and controls
186 lines (177 loc) · 6.7 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
name: Integration tests on SQL Server
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- master
- v*
paths:
- 'dbt/**'
- 'tests/functional/**'
- 'tests/functional/adapter/v2_parser/**'
- 'devops/**'
- 'docker-compose.yml'
- '**/*.lock'
- '.locks/**'
- 'pyproject.toml'
- 'pytest.ini'
- '.github/workflows/integration-tests-sqlserver.yml'
pull_request:
branches:
- master
- v*
paths:
- 'dbt/**'
- 'tests/functional/**'
- 'tests/functional/adapter/v2_parser/**'
- 'devops/**'
- 'docker-compose.yml'
- '**/*.lock'
- '.locks/**'
- 'pyproject.toml'
- 'pytest.ini'
- '.github/workflows/integration-tests-sqlserver.yml'
schedule:
- cron: '0 22 * * 0'
jobs:
integration-tests-sql-server:
name: ${{ matrix.backend }} / Py${{ matrix.python_version }} / SQL${{ matrix.sqlserver_version }} / ODBC${{ matrix.msodbc_version }} / ${{ matrix.collation }}
if: github.actor != 'dependabot[bot]'
strategy:
# Smaller matrix allows this to check if a failure is specific.
fail-fast: false
matrix:
python_version: ["3.11", "3.12", "3.13", "3.14"]
backend: [pyodbc, mssql-python]
# Baseline on 2025 (newest)
sqlserver_version: ["2025"]
msodbc_version: ["18"]
collation: [SQL_Latin1_General_CP1_CI_AS]
exclude:
- backend: mssql-python
python_version: "3.11"
sqlserver_version: "2025"
- backend: mssql-python
python_version: "3.12"
sqlserver_version: "2025"
include:
# Keep pyodbc on every supported Python version, but retain
# SQL Server ODBC 17 coverage for the oldest and newest Python.
- backend: pyodbc
python_version: "3.11"
sqlserver_version: "2025"
msodbc_version: "17"
collation: SQL_Latin1_General_CP1_CI_AS
- backend: pyodbc
python_version: "3.13"
sqlserver_version: "2025"
msodbc_version: "17"
collation: SQL_Latin1_General_CP1_CI_AS
# Older SQL Server versions stay on pyodbc only, with a single
# collation so the matrix stays small and readable.
- backend: pyodbc
python_version: "3.11"
sqlserver_version: "2017"
msodbc_version: "17"
collation: SQL_Latin1_General_CP1_CI_AS
- backend: pyodbc
python_version: "3.13"
sqlserver_version: "2019"
msodbc_version: "17"
collation: SQL_Latin1_General_CP1_CI_AS
- backend: pyodbc
python_version: "3.13"
sqlserver_version: "2022"
msodbc_version: "17"
collation: SQL_Latin1_General_CP1_CI_AS
# Add the case-sensitive collation on the SQL Server 2025 baseline
# and latest Python/backend rows.
- backend: pyodbc
python_version: "3.13"
sqlserver_version: "2025"
msodbc_version: "17"
collation: SQL_Latin1_General_CP1_CS_AS
# mssql-python stays on the latest Python only.
- backend: mssql-python
python_version: "3.13"
sqlserver_version: "2025"
msodbc_version: "18"
collation: SQL_Latin1_General_CP1_CS_AS
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}:CI-${{ matrix.python_version }}-${{ matrix.backend == 'pyodbc' && format('msodbc{0}', matrix.msodbc_version) || 'mssql' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
services:
sqlserver:
image: ghcr.io/${{ github.repository }}:server-${{ matrix.sqlserver_version }}
env:
ACCEPT_EULA: 'Y'
SA_PASSWORD: 5atyaNadella
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3
COLLATION: ${{ matrix.collation }}
steps:
- uses: actions/checkout@v7
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
INSTALL_EXTRA: ${{ matrix.backend == 'pyodbc' && 'pyodbc' || 'mssql' }}
run: uv pip install --system -e ".[$INSTALL_EXTRA]" --group dev
- name: Run functional tests
run: pytest -n auto -ra -v tests/functional --profile "ci_sql_server"
env:
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3
SQLSERVER_TEST_DRIVER: "ODBC Driver ${{ matrix.msodbc_version }} for SQL Server"
SQLSERVER_TEST_BACKEND: ${{ matrix.backend }}
v2-parser-tests:
name: V2 Parser / Py${{ matrix.python_version }} / ${{ matrix.backend }} / SQL${{ matrix.sqlserver_version }} / ODBC${{ matrix.msodbc_version }}
if: github.event_name != 'schedule' && github.actor != 'dependabot[bot]'
strategy:
fail-fast: false
matrix:
python_version: ["3.13"]
backend: [pyodbc]
sqlserver_version: ["2025"]
msodbc_version: ["18"]
collation: [SQL_Latin1_General_CP1_CI_AS]
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}:CI-${{ matrix.python_version }}-${{ matrix.backend == 'pyodbc' && format('msodbc{0}', matrix.msodbc_version) || 'mssql' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
services:
sqlserver:
image: ghcr.io/${{ github.repository }}:server-${{ matrix.sqlserver_version }}
env:
ACCEPT_EULA: 'Y'
SA_PASSWORD: 5atyaNadella
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3
COLLATION: ${{ matrix.collation }}
steps:
- uses: actions/checkout@v7
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
INSTALL_EXTRA: ${{ matrix.backend == 'pyodbc' && 'pyodbc' || 'mssql' }}
run: uv pip install --system -e ".[$INSTALL_EXTRA]" --group dev
- name: Install dbt-core-experimental-parser
run: uv pip install --system dbt-core-experimental-parser
- name: Run v2 parser tests
run: pytest -n auto -ra -v tests/functional/adapter/v2_parser --profile "ci_sql_server"
env:
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3
SQLSERVER_TEST_DRIVER: "ODBC Driver ${{ matrix.msodbc_version }} for SQL Server"
SQLSERVER_TEST_BACKEND: ${{ matrix.backend }}