Skip to content

Commit 368d6bb

Browse files
anandgupta42claude
andcommitted
ci: fix test isolation — cloud tests skip without credentials, driver E2E only on code change
CI structure: - typescript job: runs ALL tests via bun test. Cloud driver tests (Snowflake, BigQuery, Databricks) auto-skip when ALTIMATE_CODE_CONN_* env vars are absent. Docker E2E tests auto-skip when Docker unavailable. No manual exclusion needed — skipIf() handles everything. - driver-e2e job: only triggers when packages/drivers/src/** or connection infrastructure code changes. Does NOT run on every PR. Uses GitHub Actions services (PG, MySQL, MSSQL, Redshift) — no Docker-in-Docker. - Cloud credential tests (Snowflake/BigQuery/Databricks) are local-only. Never run in CI. Always skip cleanly (0 pass, 0 fail, all skip). Test timing impact: - Cloud tests: ~200ms to import+skip 90 tests (negligible) - Docker tests: skip instantly when Docker unavailable - driver-e2e job: separate workflow, doesn't block the main test job Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 31bd592 commit 368d6bb

1 file changed

Lines changed: 23 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ jobs:
4242
drivers:
4343
- 'packages/drivers/src/**'
4444
- 'packages/opencode/src/altimate/native/connections/**'
45-
- 'packages/opencode/test/altimate/drivers-*.test.ts'
45+
- 'packages/opencode/test/altimate/drivers-e2e.test.ts'
46+
- 'packages/opencode/test/altimate/drivers-docker-e2e.test.ts'
4647
- 'packages/opencode/test/altimate/connections.test.ts'
4748
49+
# ---------------------------------------------------------------------------
50+
# Main TypeScript tests — excludes driver E2E tests (separate job) and
51+
# cloud credential tests (local-only).
52+
# ---------------------------------------------------------------------------
4853
typescript:
4954
name: TypeScript
5055
needs: changes
@@ -77,18 +82,22 @@ jobs:
7782
- name: Run tests
7883
run: bun test
7984
working-directory: packages/opencode
85+
# Cloud E2E tests (Snowflake, BigQuery, Databricks) auto-skip when
86+
# ALTIMATE_CODE_CONN_* env vars are not set. Docker E2E tests auto-skip
87+
# when Docker is not available. No exclusion needed — skipIf handles it.
8088

8189
# ---------------------------------------------------------------------------
82-
# Driver E2E tests — run when driver code or connection infra changes.
83-
# Uses Docker for PostgreSQL, MySQL, SQL Server, Redshift (PG wire-compat).
84-
# DuckDB and SQLite run without Docker (embedded).
90+
# Driver E2E tests — only when driver code changes.
91+
# Uses GitHub Actions services (no Docker-in-Docker).
92+
# Cloud tests (Snowflake, BigQuery, Databricks) are NOT run here —
93+
# they require real credentials and are run locally only.
8594
# ---------------------------------------------------------------------------
8695
driver-e2e:
8796
name: Driver E2E
8897
needs: changes
89-
if: needs.changes.outputs.drivers == 'true' || github.event_name == 'push'
98+
if: needs.changes.outputs.drivers == 'true'
9099
runs-on: ubuntu-latest
91-
timeout-minutes: 15
100+
timeout-minutes: 10
92101
services:
93102
postgres:
94103
image: postgres:16-alpine
@@ -128,7 +137,6 @@ jobs:
128137
--health-timeout 10s
129138
--health-retries 20
130139
131-
# Redshift wire-compatible (uses PostgreSQL)
132140
redshift:
133141
image: postgres:16-alpine
134142
env:
@@ -159,16 +167,15 @@ jobs:
159167
- name: Install dependencies
160168
run: bun install
161169

162-
- name: Run local driver E2E tests (DuckDB, SQLite, PostgreSQL)
170+
- name: Run local driver E2E (DuckDB, SQLite, PostgreSQL)
163171
run: bun test test/altimate/drivers-e2e.test.ts
164172
working-directory: packages/opencode
165173
env:
166-
# PostgreSQL service is available on port 15432
167174
TEST_PG_HOST: 127.0.0.1
168175
TEST_PG_PORT: "15432"
169176
TEST_PG_PASSWORD: testpass123
170177

171-
- name: Run Docker driver E2E tests (MySQL, SQL Server, Redshift)
178+
- name: Run Docker driver E2E (MySQL, SQL Server, Redshift)
172179
run: bun test test/altimate/drivers-docker-e2e.test.ts
173180
working-directory: packages/opencode
174181
env:
@@ -182,6 +189,12 @@ jobs:
182189
TEST_REDSHIFT_PORT: "15439"
183190
TEST_REDSHIFT_PASSWORD: testpass123
184191

192+
# Cloud tests NOT included — they require real credentials
193+
# Run locally with:
194+
# ALTIMATE_CODE_CONN_SNOWFLAKE_TEST='...' bun test test/altimate/drivers-snowflake-e2e.test.ts
195+
# ALTIMATE_CODE_CONN_BIGQUERY_TEST='...' bun test test/altimate/drivers-bigquery-e2e.test.ts
196+
# ALTIMATE_CODE_CONN_DATABRICKS_TEST='...' bun test test/altimate/drivers-databricks-e2e.test.ts
197+
185198
marker-guard:
186199
name: Marker Guard
187200
runs-on: ubuntu-latest
@@ -207,7 +220,6 @@ jobs:
207220

208221
- name: Check for missing altimate_change markers
209222
run: |
210-
# Skip strict marker enforcement for upstream merge PRs — all changes come from upstream
211223
if [[ "${{ github.head_ref }}" == merge-upstream-* ]] || [[ "${{ github.head_ref }}" == upstream/merge-* ]]; then
212224
echo "Upstream merge PR detected — running marker check in non-strict mode"
213225
bun run script/upstream/analyze.ts --markers --base ${{ github.event.pull_request.base.ref }}

0 commit comments

Comments
 (0)