Skip to content

Commit

Permalink
testing #445
Browse files Browse the repository at this point in the history
  • Loading branch information
michelley-an authored Oct 2, 2024
1 parent d06f20f commit de3f2de
Show file tree
Hide file tree
Showing 13 changed files with 148 additions and 12 deletions.
83 changes: 82 additions & 1 deletion .github/workflows/ci_test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
strategy:
fail-fast: false # Don't fail one DWH if the others fail
matrix:
warehouse: ["snowflake", "bigquery", "postgres", "sqlserver"]
warehouse: ["snowflake", "bigquery", "postgres"]
# When supporting a new version, update the list here
version: ["1_3_0", "1_4_0", "1_5_0", "1_6_0", "1_7_0", "1_8_0"]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -193,3 +193,84 @@ jobs:
# env:
# DBT_VERSION: ''
# run: tox -e integration_databricks

integration-sqlserver:
strategy:
fail-fast: false # Don't fail one DWH if the others fail
runs-on: ubuntu-latest
environment:
name: Approve Integration Tests

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.8.x"
architecture: "x64"
- name: Install SQL Server
uses: Particular/[email protected]
with:
connection-string-env-var: SQL_SERVER_CONNECTION_STRING
catalog: dbt_artifact_integrationtests
- name: Create DBT User
shell: pwsh
run: |
echo "Create dbt login with sysadmin"
sqlcmd -Q "CREATE LOGIN dbt WITH PASSWORD = '123', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF" -d "dbt_artifact_integrationtests"
sqlcmd -Q "ALTER SERVER ROLE sysadmin ADD MEMBER dbt" -d "dbt_artifact_integrationtests"
- name: Install tox
run: python3 -m pip install tox

- name: Install Microsoft ODBC
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y

- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR

- name: Run Tests on PR
env:
DBT_VERSION: ${{ matrix.version }}
run: tox -e integration_sqlserver

integration-sqlserver-single-run:
strategy:
fail-fast: false # Don't fail one DWH if the others fail
matrix:
# When supporting a new version, update the list here
version: ["1_3_0", "1_4_0", "1_7_0", "1_8_0"]
runs-on: ubuntu-latest
environment:
name: Approve Integration Tests

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.8.x"
architecture: "x64"
- name: Install SQL Server
uses: Particular/[email protected]
with:
connection-string-env-var: SQL_SERVER_CONNECTION_STRING
catalog: dbt_artifact_integrationtests
- name: Create DBT User
shell: pwsh
run: |
echo "Create dbt login with sysadmin"
sqlcmd -Q "CREATE LOGIN dbt WITH PASSWORD = '123', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF" -d "dbt_artifact_integrationtests"
sqlcmd -Q "ALTER SERVER ROLE sysadmin ADD MEMBER dbt" -d "dbt_artifact_integrationtests"
- name: Install tox
run: python3 -m pip install tox

- name: Install Microsoft ODBC
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y

- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR

- name: Run Tests on PR
env:
DBT_VERSION: ${{ matrix.version }}
run: tox -e integration_sqlserver_${{ matrix.version }}
44 changes: 43 additions & 1 deletion .github/workflows/main_test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
integration:
strategy:
matrix:
warehouse: ["snowflake", "bigquery", "postgres", "sqlserver"]
warehouse: ["snowflake", "bigquery", "postgres"]
version: ["1_3_0", "1_4_0", "1_5_0", "1_6_0", "1_7_0", "1_8_0"]
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -102,3 +102,45 @@ jobs:

# - name: Run Databricks Tests
# run: tox -e integration_databricks

integration-sqlserver:
strategy:
fail-fast: false # Don't fail one DWH if the others fail
matrix:
# When supporting a new version, update the list here
version: ["1_3_0", "1_4_0", "1_7_0", "1_8_0"]
runs-on: ubuntu-latest
environment:
name: Approve Integration Tests

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.8.x"
architecture: "x64"
- name: Install SQL Server
uses: Particular/[email protected]
with:
connection-string-env-var: SQL_SERVER_CONNECTION_STRING
catalog: dbt_artifact_integrationtests
- name: Create DBT User
shell: pwsh
run: |
echo "Create dbt login with sysadmin"
sqlcmd -Q "CREATE LOGIN dbt WITH PASSWORD = '123', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF" -d "dbt_artifact_integrationtests"
sqlcmd -Q "ALTER SERVER ROLE sysadmin ADD MEMBER dbt" -d "dbt_artifact_integrationtests"
- name: Install tox
run: python3 -m pip install tox

- name: Install Microsoft ODBC
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y

- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR

- name: Run Tests on PR
env:
DBT_VERSION: ${{ matrix.version }}
run: tox -e integration_sqlserver_${{ matrix.version }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ See the generated [dbt docs site](https://brooklyn-data.github.io/dbt_artifacts/
```
packages:
- package: brooklyn-data/dbt_artifacts
version: 2.6.4
version: 2.7.1
```

:construction_worker: Make sure to fix at least the **minor** version, to avoid issues when a new release is open. See the notes on upgrading below for more detail.
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "dbt_artifacts"
version: "2.6.4"
version: "2.7.1"
config-version: 2
require-dbt-version: [">=1.3.0", "<1.9.0"]
profile: "dbt_artifacts"
Expand Down
3 changes: 2 additions & 1 deletion integration_test_project/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ dbt_artifacts:
schema: dbo
windows_login: False
trust_cert: True
user: sa
Encrypt: False
user: dbt
password: "123"
2 changes: 2 additions & 0 deletions models/dim_dbt__current_models.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
with
base as (select * from {{ ref("stg_dbt__models") }}),

model_executions as (select * from {{ ref("stg_dbt__model_executions") }}),

latest_models as (

/* Retrieves the models present in the most recent run */
Expand Down
1 change: 1 addition & 0 deletions models/staging/stg_dbt__model_executions.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with
base as (select * from {{ ref("model_executions") }}),

enhanced as (

select
Expand Down
1 change: 1 addition & 0 deletions models/staging/stg_dbt__models.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with
base as (select * from {{ ref("models") }}),

enhanced as (

select
Expand Down
1 change: 1 addition & 0 deletions models/staging/stg_dbt__seed_executions.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with
base as (select * from {{ ref("seed_executions") }}),

enhanced as (

select
Expand Down
1 change: 1 addition & 0 deletions models/staging/stg_dbt__seeds.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with
base as (select * from {{ ref("seeds") }}),

enhanced as (

select
Expand Down
1 change: 1 addition & 0 deletions models/staging/stg_dbt__snapshot_executions.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with
base as (select * from {{ ref("snapshot_executions") }}),

enhanced as (

select
Expand Down
1 change: 1 addition & 0 deletions models/staging/stg_dbt__sources.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with
base as (select * from {{ ref("sources") }}),

enhanced as (

select
Expand Down
18 changes: 11 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -355,32 +355,36 @@ commands =

[testenv:integration_sqlserver]
changedir = integration_test_project
deps = dbt-sqlserver~=1.8.4
deps = dbt-sqlserver~=1.8.0
commands =
dbt clean
dbt deps
dbt build --target sqlserver

[testenv:integration_sqlserver_1_4_3]
[testenv:integration_sqlserver_1_3_0]
changedir = integration_test_project
deps = dbt-sqlserver~=1.4.3
deps = dbt-sqlserver~=1.3.0
commands =
dbt clean
dbt deps
dbt build --target sqlserver

[testenv:integration_sqlserver_1_7_4]
[testenv:integration_sqlserver_1_4_0]
changedir = integration_test_project
deps = dbt-sqlserver~=1.7.4
deps = dbt-sqlserver~=1.4.0
commands =
dbt clean
dbt deps
dbt build --target sqlserver

[testenv:integration_sqlserver_1_8_4]
[testenv:integration_sqlserver_1_7_0]
changedir = integration_test_project
deps = dbt-sqlserver~=1.8.4
deps = dbt-sqlserver~=1.7.0
commands =
dbt clean
dbt deps
dbt build --target sqlserver

[testenv:integration_sqlserver_1_8_0]
changedir = integration_test_project
deps = dbt-sqlserver~=1.8.0

0 comments on commit de3f2de

Please sign in to comment.