@@ -76,85 +76,31 @@ defaults:
7676 shell : bash
7777
7878jobs :
79- # generate test metadata about what files changed and the testing matrix to use
80- test-metadata :
81- # run if not a PR from a forked repository or has a label to mark as safe to test
82- if : >-
83- github.event_name != 'pull_request_target' ||
84- github.event.pull_request.head.repo.full_name == github.repository ||
85- contains(github.event.pull_request.labels.*.name, 'ok to test')
86- runs-on : ubuntu-latest
87- outputs :
88- matrix : ${{ steps.generate-matrix.outputs.result }}
89-
90- steps :
91- - name : Check out the repository (non-PR)
92- if : github.event_name != 'pull_request_target'
93- uses : actions/checkout@v4
94- with :
95- persist-credentials : false
96-
97- - name : Check out the repository (PR)
98- if : github.event_name == 'pull_request_target'
99- uses : actions/checkout@v4
100- with :
101- persist-credentials : false
102- ref : ${{ github.event.pull_request.head.sha }}
103-
104- - name : Check if relevant files changed
105- if : github.event_name == 'pull_request_target'
106- # https://github.com/marketplace/actions/paths-changes-filter
107- # For each filter, it sets output variable named by the filter to the text:
108- # 'true' - if any of changed files matches any of filter rules
109- # 'false' - if none of changed files matches any of filter rules
110- # also, returns:
111- # `changes` - JSON array with names of all filters matching any of the changed files
112- uses : dorny/paths-filter@v3
113- id : get-changes
114- with :
115- token : ${{ secrets.GITHUB_TOKEN }}
116- filters : |
117- snowflake:
118- - '.github/**/*.yml'
119- - '.github/**/*.sh'
120- - 'dbt/**'
121- - 'tests/**'
122- - 'dev-requirements.txt'
123- - '*.py'
124- - name : Generate integration test matrix
125- id : generate-matrix
126- uses : actions/github-script@v7
127- env :
128- CHANGES : ${{ steps.get-changes.outputs.changes }}
129- with :
130- script : |
131- const script = require('./.github/scripts/integration-test-matrix.js')
132- const matrix = script({ context })
133- console.log(matrix)
134- return matrix
13579 test :
136- name : ${{ matrix.adapter }} / python ${{ matrix.python-version }} / ${{ matrix.os }}
80+ name : ${{ matrix.os }} / python ${{ matrix.python-version }}
13781
13882 # run if not a PR from a forked repository or has a label to mark as safe to test
13983 # also checks that the matrix generated is not empty
14084 if : >-
141- needs.test-metadata.outputs.matrix &&
142- fromJSON( needs.test-metadata.outputs.matrix ).include[0] &&
14385 (
14486 github.event_name != 'pull_request_target' ||
14587 github.event.pull_request.head.repo.full_name == github.repository ||
14688 contains(github.event.pull_request.labels.*.name, 'ok to test')
14789 )
14890 runs-on : ${{ matrix.os }}
149- needs : test-metadata
15091
15192 strategy :
15293 fail-fast : false
153- matrix : ${{ fromJSON(needs.test-metadata.outputs.matrix) }}
94+ matrix :
95+ os : [ubuntu-22.04]
96+ python-version : ["3.9", "3.10", "3.11", "3.12"]
97+ include :
98+ - os : macos-14
99+ python-version : " 3.9"
100+ - os : windows-2022
101+ python-version : " 3.9"
154102
155103 env :
156- TOXENV : integration-${{ matrix.adapter }}
157- PYTEST_ADDOPTS : " -v --color=yes -n4 --csv integration_results.csv"
158104 DBT_INVOCATION_ENV : github-actions
159105 DD_CIVISIBILITY_AGENTLESS_ENABLED : true
160106 DD_API_KEY : ${{ secrets.DATADOG_API_KEY }}
@@ -190,24 +136,19 @@ jobs:
190136 with :
191137 python-version : ${{ matrix.python-version }}
192138
193- - name : Update Adapters and Core branches (update dev_requirements.txt )
139+ - name : Update Adapters and Core branches (update hatch.toml )
194140 if : ${{ github.event_name == 'workflow_dispatch' }}
195141 run : |
196142 ./.github/scripts/update_dev_dependency_branches.sh \
197143 ${{ inputs.dbt_adapters_branch }} \
198144 ${{ inputs.dbt_core_branch }} \
199145 ${{ inputs.dbt_common_branch }}
200- cat dev-requirements.txt
146+ cat hatch.toml
201147
202148 - name : Install python dependencies
203- run : |
204- python -m pip install --user --upgrade pip
205- python -m pip install tox
206- python -m pip --version
207- tox --version
149+ uses : pypa/hatch@install
208150
209- - name : Run tox (snowflake)
210- if : matrix.adapter == 'snowflake'
151+ - run : hatch run integration-tests tests/functional --ddtrace
211152 env :
212153 SNOWFLAKE_TEST_ACCOUNT : ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }}
213154 SNOWFLAKE_TEST_PASSWORD : ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
@@ -226,26 +167,6 @@ jobs:
226167 DBT_TEST_USER_1 : dbt_test_role_1
227168 DBT_TEST_USER_2 : dbt_test_role_2
228169 DBT_TEST_USER_3 : dbt_test_role_3
229- run : tox -- --ddtrace
230-
231- - name : Get current date
232- if : always()
233- id : date
234- run : echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT # no colons allowed for artifacts
235-
236- - uses : actions/upload-artifact@v4
237- if : always()
238- with :
239- name : logs_${{ matrix.python-version }}_${{ matrix.os }}_${{ matrix.adapter }}-${{ steps.date.outputs.date }}
240- path : ./logs
241- overwrite : true
242-
243- - uses : actions/upload-artifact@v4
244- if : always()
245- with :
246- name : integration_results_${{ matrix.python-version }}_${{ matrix.os }}_${{ matrix.adapter }}-${{ steps.date.outputs.date }}.csv
247- path : integration_results.csv
248- overwrite : true
249170
250171 require-label-comment :
251172 runs-on : ubuntu-latest
0 commit comments