1- # Min-Deps Integration Tests (slow)
1+ # Integration Tests (Min-Deps) for dbt-databricks
22#
33# Sharded functional tests against the lowest-direct dependency resolution
44# committed in requirements.lowest-direct.txt. Mirrors integration.yml's
55# fan-out (skip-if-unchanged on schedule, prepare-shards via LPT historical
66# timing, sharded execution per profile, gather-shards verification) but
77# routes every pytest invocation through the `min-deps:` hatch env.
88#
9- # Triggering: schedule only.
10-
11- name : Min-Deps Tests (slow)
9+ # Triggering:
10+ # 1. On a PR (internal OR fork): a maintainer comments `/integration-test min-deps`.
11+ # The integration-trigger workflow validates the comment author and
12+ # dispatches this workflow with the PR number. The run posts a result
13+ # comment back to the PR when the matrix completes.
14+ # 2. Manually from the Actions tab (workflow_dispatch):
15+ # - One PR (e.g. "100") OR comma-separated list ("100,200,300") in pr_numbers.
16+ # - Or a git_ref for ad-hoc testing.
17+ # 3. Nightly on `main` at 19:30 UTC (2h before integration.yml's 21:30 nightly).
18+ # The `prepare` job short-circuits if the current main SHA has already had a
19+ # successful min-deps integration run, emitting an empty targets array so
20+ # the matrix jobs skip cleanly.
21+
22+ name : Integration Tests (Min-Deps)
1223on :
24+ workflow_dispatch :
25+ inputs :
26+ pr_numbers :
27+ description : " PR number(s) to test — single PR or comma-separated for batch (e.g. '100' or '100,200,300')"
28+ required : false
29+ type : string
30+ git_ref :
31+ description : " Git ref (branch/tag/commit) to test — used only when pr_numbers is empty"
32+ required : false
33+ type : string
34+
1335 schedule :
1436 - cron : " 30 19 * * *" # 19:30 UTC, 2h before integration.yml's nightly
1537
@@ -18,7 +40,7 @@ permissions:
1840 contents : read
1941
2042concurrency :
21- group : ${{ github.workflow }}-${{ github.ref }}
43+ group : ${{ github.workflow }}-${{ github.event.inputs.pr_numbers || github.event.inputs.git_ref || github. ref }}
2244 cancel-in-progress : true
2345
2446defaults :
@@ -43,23 +65,46 @@ jobs:
4365 id : parse
4466 shell : bash
4567 env :
68+ EVENT_NAME : ${{ github.event_name }}
69+ INPUT_PR_NUMBERS : ${{ github.event.inputs.pr_numbers }}
70+ INPUT_GIT_REF : ${{ github.event.inputs.git_ref }}
4671 DEFAULT_REF : ${{ github.ref }}
4772 GH_TOKEN : ${{ github.token }}
4873 run : |
4974 set -euo pipefail
5075 entry() { printf '{"pr":"%s","ref":"%s"}' "$1" "$2"; }
5176 targets="["
52- # Nightly skip-if-unchanged: if this main SHA already has a green
53- # min-deps-slow run, emit empty targets so the matrix jobs skip.
54- already_tested=$(curl -sfS \
55- -H "Authorization: Bearer $GH_TOKEN" \
56- -H "Accept: application/vnd.github+json" \
57- "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/min-deps-test-slow.yml/runs?branch=main&status=success&head_sha=$GITHUB_SHA" \
58- | jq -r '.total_count // 0')
59- if [[ "$already_tested" -gt 0 ]]; then
60- echo "Nightly skip: main @ $GITHUB_SHA already has $already_tested successful run(s)."
77+ if [[ "$EVENT_NAME" == "schedule" ]]; then
78+ # Nightly skip-if-unchanged: if this main SHA already has a green
79+ # min-deps integration run, emit empty targets so the matrix jobs skip.
80+ already_tested=$(curl -sfS \
81+ -H "Authorization: Bearer $GH_TOKEN" \
82+ -H "Accept: application/vnd.github+json" \
83+ "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/integration-min-deps.yml/runs?branch=main&status=success&head_sha=$GITHUB_SHA" \
84+ | jq -r '.total_count // 0')
85+ if [[ "$already_tested" -gt 0 ]]; then
86+ echo "Nightly skip: main @ $GITHUB_SHA already has $already_tested successful run(s)."
87+ else
88+ targets+=$(entry "nightly" "$DEFAULT_REF")
89+ fi
90+ elif [[ -n "${INPUT_PR_NUMBERS//[[:space:]]/}" ]]; then
91+ first=1
92+ IFS=',' read -ra prs <<< "$INPUT_PR_NUMBERS"
93+ for pr in "${prs[@]}"; do
94+ pr_trimmed="${pr//[[:space:]]/}"
95+ [[ -z "$pr_trimmed" ]] && continue
96+ if [[ ! "$pr_trimmed" =~ ^[0-9]+$ ]]; then
97+ echo "::error::Invalid PR number '$pr_trimmed' in pr_numbers='$INPUT_PR_NUMBERS' — expected digits, comma-separated."
98+ exit 1
99+ fi
100+ [[ $first -eq 0 ]] && targets+=","
101+ first=0
102+ targets+=$(entry "$pr_trimmed" "refs/pull/$pr_trimmed/head")
103+ done
104+ elif [[ -n "${INPUT_GIT_REF//[[:space:]]/}" ]]; then
105+ targets+=$(entry "manual" "$INPUT_GIT_REF")
61106 else
62- targets+=$(entry "nightly " "$DEFAULT_REF")
107+ targets+=$(entry "manual " "$DEFAULT_REF")
63108 fi
64109 targets+="]"
65110 echo "targets=$targets" >> "$GITHUB_OUTPUT"
@@ -97,7 +142,12 @@ jobs:
97142 with :
98143 ref : ${{ matrix.target.ref }}
99144
100- - name : Setup JFrog PyPI Proxy
145+ - name : Setup Python Dependencies
146+ id : deps
147+ uses : ./.github/actions/setup-python-deps
148+
149+ - name : Setup JFrog PyPI Proxy (fallback)
150+ if : steps.deps.outputs.cache-hit != 'true'
101151 uses : ./.github/actions/setup-jfrog-pypi
102152
103153 - name : Set up python
@@ -193,7 +243,12 @@ jobs:
193243 with :
194244 ref : ${{ matrix.target.ref }}
195245
196- - name : Setup JFrog PyPI Proxy
246+ - name : Setup Python Dependencies
247+ id : deps
248+ uses : ./.github/actions/setup-python-deps
249+
250+ - name : Setup JFrog PyPI Proxy (fallback)
251+ if : steps.deps.outputs.cache-hit != 'true'
197252 uses : ./.github/actions/setup-jfrog-pypi
198253
199254 - name : Set up python
@@ -287,7 +342,12 @@ jobs:
287342 with :
288343 ref : ${{ matrix.target.ref }}
289344
290- - name : Setup JFrog PyPI Proxy
345+ - name : Setup Python Dependencies
346+ id : deps
347+ uses : ./.github/actions/setup-python-deps
348+
349+ - name : Setup JFrog PyPI Proxy (fallback)
350+ if : steps.deps.outputs.cache-hit != 'true'
291351 uses : ./.github/actions/setup-jfrog-pypi
292352
293353 - name : Set up python
@@ -379,7 +439,12 @@ jobs:
379439 with :
380440 ref : ${{ matrix.target.ref }}
381441
382- - name : Setup JFrog PyPI Proxy
442+ - name : Setup Python Dependencies
443+ id : deps
444+ uses : ./.github/actions/setup-python-deps
445+
446+ - name : Setup JFrog PyPI Proxy (fallback)
447+ if : steps.deps.outputs.cache-hit != 'true'
383448 uses : ./.github/actions/setup-jfrog-pypi
384449
385450 - name : Set up python
@@ -511,3 +576,54 @@ jobs:
511576 echo "::error::One or more shard-verification invariants failed."
512577 exit 1
513578 fi
579+
580+ # Posts a per-job pass/fail summary comment back to the PR when dispatched
581+ # with a single PR number (the slash-command path). Skipped for batch
582+ # dispatches and for schedule / git_ref runs.
583+ report-status :
584+ needs :
585+ - run-uc-cluster-e2e-tests
586+ - run-sqlwarehouse-e2e-tests
587+ - run-cluster-e2e-tests
588+ - gather-shards
589+ if : |
590+ always() &&
591+ github.event_name == 'workflow_dispatch' &&
592+ inputs.pr_numbers != '' &&
593+ !contains(inputs.pr_numbers, ',')
594+ runs-on :
595+ group : databricks-protected-runner-group
596+ labels : linux-ubuntu-latest
597+ permissions :
598+ pull-requests : write
599+ steps :
600+ - name : Post result comment
601+ uses : actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
602+ env :
603+ PR_NUMBER : ${{ inputs.pr_numbers }}
604+ UC_RESULT : ${{ needs.run-uc-cluster-e2e-tests.result }}
605+ SQLW_RESULT : ${{ needs.run-sqlwarehouse-e2e-tests.result }}
606+ CLUSTER_RESULT : ${{ needs.run-cluster-e2e-tests.result }}
607+ GATHER_RESULT : ${{ needs.gather-shards.result }}
608+ with :
609+ script : |
610+ const ICONS = { success: ':white_check_mark:', skipped: ':fast_forward:' };
611+ const results = {
612+ 'UC cluster': process.env.UC_RESULT,
613+ 'SQL warehouse': process.env.SQLW_RESULT,
614+ 'All-purpose cluster': process.env.CLUSTER_RESULT,
615+ 'Shard coverage': process.env.GATHER_RESULT,
616+ };
617+ const line = Object.entries(results)
618+ .map(([name, r]) => `${name} ${ICONS[r] || ':x:'} ${r}`)
619+ .join(' · ');
620+ const runUrl =
621+ `https://github.com/${context.repo.owner}/${context.repo.repo}` +
622+ `/actions/runs/${context.runId}`;
623+ const prNumber = process.env.PR_NUMBER.trim();
624+ await github.rest.issues.createComment({
625+ owner: context.repo.owner,
626+ repo: context.repo.repo,
627+ issue_number: parseInt(prNumber, 10),
628+ body: `Min-deps integration results for PR #${prNumber} — ${line}\n\n[Run details](${runUrl}).`,
629+ });
0 commit comments