Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/integration-tests-sqlserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on: # yamllint disable-line rule:truthy
paths:
- 'dbt/**'
- 'tests/functional/**'
- 'tests/functional/adapter/v2_parser/**'
- 'devops/**'
- 'docker-compose.yml'
- '**/*.lock'
Expand All @@ -23,6 +24,7 @@ on: # yamllint disable-line rule:truthy
paths:
- 'dbt/**'
- 'tests/functional/**'
- 'tests/functional/adapter/v2_parser/**'
- 'devops/**'
- 'docker-compose.yml'
- '**/*.lock'
Expand Down Expand Up @@ -132,3 +134,53 @@ jobs:
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 }}
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ All CI/CD pipelines are using GitHub Actions. The following pipelines are availa

* `publish-docker`: publishes the image we use in all other pipelines.
* `unit-tests`: runs the unit tests for each supported Python version.
* `integration-tests-sqlserver`: runs the integration tests for SQL Server.
* `integration-tests-sqlserver`: runs the integration tests for SQL Server (includes the `v2-parser-tests` job).
* `release-version`: publishes the adapter to PyPI.

There is an additional [Pre-commit](https://pre-commit.ci/) pipeline that validates the code style.
Expand All @@ -131,3 +131,7 @@ Make sure the version number is bumped in `dbt/adapters/sqlserver/__version__.py
A GitHub Actions workflow will be triggered to build the package and push it to PyPI.

If you're releasing support for a new version of `dbt-core`, also bump the `dbt-core` constraint in `dependencies` in `pyproject.toml`.

## V2 Parser (Experimental)

See [docs/contributing/v2-parser.md](docs/contributing/v2-parser.md) for details on the experimental Rust-based v2 parser, local setup, CI integration, known limitations, and manifest comparison.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ functional: ## Runs functional tests.
@\
uv run pytest -n $(THREADS) -ra -v tests/functional

.PHONY: v2-parser-test
v2-parser-test: ## Runs v2 parser functional tests. Requires dbt-core-experimental-parser on PATH and a running SQL Server.
@\
uv run pytest -m v2_parser tests/functional/adapter/v2_parser -v

.PHONY: test
test: ## Runs unit tests and code checks against staged changes.
@status=0; \
Expand Down
Loading
Loading