Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 2580ac5

Browse files
authored
Integration workflow update to support all-in-one adapter testing (#1082)
1 parent 46348bc commit 2580ac5

File tree

3 files changed

+64
-27
lines changed

3 files changed

+64
-27
lines changed

.github/scripts/update_dbt_core_branch.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -e
2+
set -e
3+
4+
5+
dbt_adapters_branch=$1
6+
dbt_core_branch=$2
7+
dbt_common_branch=$3
8+
target_req_file="dev-requirements.txt"
9+
core_req_sed_pattern="s|dbt-core.git.*#egg=dbt-core|dbt-core.git@${dbt_core_branch}#egg=dbt-core|g"
10+
adapters_req_sed_pattern="s|dbt-adapters.git|dbt-adapters.git@${dbt_adapters_branch}|g"
11+
common_req_sed_pattern="s|dbt-common.git|dbt-common.git@${dbt_common_branch}|g"
12+
if [[ "$OSTYPE" == darwin* ]]; then
13+
# mac ships with a different version of sed that requires a delimiter arg
14+
sed -i "" "$adapters_req_sed_pattern" $target_req_file
15+
sed -i "" "$core_req_sed_pattern" $target_req_file
16+
sed -i "" "$common_req_sed_pattern" $target_req_file
17+
else
18+
sed -i "$adapters_req_sed_pattern" $target_req_file
19+
sed -i "$core_req_sed_pattern" $target_req_file
20+
sed -i "$common_req_sed_pattern" $target_req_file
21+
fi

.github/workflows/integration.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
name: Adapter Integration Tests
1212

13+
run-name: "${{ (contains(github.event_name, 'workflow_') && inputs.name) || github.event_name }}: ${{ (contains(github.event_name, 'workflow_') && inputs.adapter_branch) || github.ref_name }} by @${{ github.actor }}"
14+
1315
on:
1416
push:
1517
branches:
@@ -24,10 +26,31 @@ on:
2426

2527
workflow_dispatch:
2628
inputs:
27-
dbt-core-branch:
28-
description: "branch of dbt-core to use in dev-requirements.txt"
29+
name:
30+
description: "Name to associate with run (example: 'dbt-adapters-242')"
2931
required: false
3032
type: string
33+
default: "Adapter Integration Tests"
34+
adapter_branch:
35+
description: "The branch of this adapter repository to use"
36+
type: string
37+
required: false
38+
default: "main"
39+
dbt_adapters_branch:
40+
description: "The branch of dbt-adapters to use"
41+
type: string
42+
required: false
43+
default: "main"
44+
dbt_core_branch:
45+
description: "The branch of dbt-core to use"
46+
type: string
47+
required: false
48+
default: "main"
49+
dbt_common_branch:
50+
description: "The branch of dbt-common to use"
51+
type: string
52+
required: false
53+
default: "main"
3154

3255
# explicitly turn off permissions for `GITHUB_TOKEN`
3356
permissions: read-all
@@ -74,12 +97,19 @@ jobs:
7497
DBT_TEST_USER_3: "[email protected]"
7598

7699
steps:
77-
- name: Check out the repository
78-
if: github.event_name != 'pull_request_target'
100+
- name: Check out the repository (push)
101+
if: github.event_name == 'push'
79102
uses: actions/checkout@v4
80103
with:
81104
persist-credentials: false
82105

106+
- name: Check out the repository (workflow_dispatch)
107+
if: github.event_name == 'workflow_dispatch'
108+
uses: actions/checkout@v4
109+
with:
110+
persist-credentials: false
111+
ref: ${{ inputs.adapter_branch }}
112+
83113
# explicitly checkout the branch for the PR,
84114
# this is necessary for the `pull_request` event
85115
- name: Check out the repository (PR)
@@ -95,17 +125,20 @@ jobs:
95125
with:
96126
python-version: "3.11"
97127

128+
- name: Update Adapters and Core branches (update dev_requirements.txt)
129+
if: github.event_name == 'workflow_dispatch'
130+
run: |
131+
./.github/scripts/update_dev_dependency_branches.sh \
132+
${{ inputs.dbt_adapters_branch }} \
133+
${{ inputs.dbt_core_branch }} \
134+
${{ inputs.dbt_common_branch }}
135+
cat dev-requirements.txt
136+
98137
- name: Install python dependencies
99138
run: |
100139
python -m pip install --user --upgrade pip
101140
python -m pip --version
102141
python -m pip install -r dagger/requirements.txt
103142
104-
- name: Update dev_requirements.txt
105-
if: inputs.dbt-core-branch != ''
106-
run: |
107-
pip install bumpversion
108-
./.github/scripts/update_dbt_core_branch.sh ${{ inputs.dbt-core-branch }}
109-
110143
- name: Run tests for ${{ matrix.test }}
111144
run: python dagger/run_dbt_spark_tests.py --profile ${{ matrix.test }}

0 commit comments

Comments
 (0)