Skip to content

Commit 34cbcd8

Browse files
pgflow botjumski
authored andcommitted
test: add bun smoke coverage for edge worker
1 parent 32e76c9 commit 34cbcd8

3 files changed

Lines changed: 66 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,41 @@ jobs:
172172
if: steps.check.outputs.affected == 'true'
173173
run: pnpm nx run edge-worker:test:integration
174174

175-
# ─────────────────────────────────────── 2b. CLI E2E ──────────────────────────────────────
175+
# ─────────────────────────────────────── 2b. EDGE-WORKER BUN SMOKE ──────────────────────────────────────
176+
edge-worker-bun-smoke:
177+
needs: pre_job
178+
if: needs.pre_job.outputs.should_skip != 'true'
179+
runs-on: ubuntu-latest
180+
env:
181+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
182+
steps:
183+
- uses: actions/checkout@v4
184+
with:
185+
fetch-depth: 0
186+
187+
- uses: ./.github/actions/setup
188+
with:
189+
github-token: ${{ secrets.GITHUB_TOKEN }}
190+
atlas-cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN }}
191+
192+
- uses: oven-sh/setup-bun@v2
193+
194+
- name: Check if edge-worker is affected
195+
id: check
196+
run: |
197+
if pnpm nx show projects --affected --base=origin/main --head=HEAD | grep -q "^edge-worker$"; then
198+
echo "affected=true" >> $GITHUB_OUTPUT
199+
echo "edge-worker is affected, running Bun smoke"
200+
else
201+
echo "affected=false" >> $GITHUB_OUTPUT
202+
echo "edge-worker not affected, skipping Bun smoke"
203+
fi
204+
205+
- name: Run edge-worker Bun smoke
206+
if: steps.check.outputs.affected == 'true'
207+
run: pnpm nx run edge-worker:smoke:bun
208+
209+
# ─────────────────────────────────────── 2c. CLI E2E ──────────────────────────────────────
176210
cli-e2e:
177211
needs: pre_job
178212
if: needs.pre_job.outputs.should_skip != 'true'
@@ -208,7 +242,7 @@ jobs:
208242
if: steps.check.outputs.affected == 'true'
209243
run: pnpm nx run cli:e2e
210244

211-
# ─────────────────────────────────────── 2c. CLIENT E2E ──────────────────────────────────────
245+
# ─────────────────────────────────────── 2d. CLIENT E2E ──────────────────────────────────────
212246
client-e2e:
213247
needs: pre_job
214248
if: needs.pre_job.outputs.should_skip != 'true'
@@ -244,7 +278,7 @@ jobs:
244278
if: steps.check.outputs.affected == 'true'
245279
run: pnpm nx run client:e2e
246280

247-
# ─────────────────────────────────────── 2d. CORE PGTAP ──────────────────────────────────────
281+
# ─────────────────────────────────────── 2e. CORE PGTAP ──────────────────────────────────────
248282
core-pgtap:
249283
needs: pre_job
250284
if: needs.pre_job.outputs.should_skip != 'true'
@@ -288,6 +322,7 @@ jobs:
288322
build-and-test,
289323
edge-worker-e2e,
290324
edge-worker-integration,
325+
edge-worker-bun-smoke,
291326
cli-e2e,
292327
client-e2e,
293328
core-pgtap,
@@ -340,6 +375,7 @@ jobs:
340375
build-and-test,
341376
edge-worker-e2e,
342377
edge-worker-integration,
378+
edge-worker-bun-smoke,
343379
cli-e2e,
344380
client-e2e,
345381
core-pgtap,

pkgs/edge-worker/project.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@
152152
"cwd": "pkgs/edge-worker"
153153
}
154154
},
155+
"smoke:bun": {
156+
"executor": "nx:run-commands",
157+
"dependsOn": ["build"],
158+
"options": {
159+
"command": "bun run scripts/smoke-bun-dist.ts",
160+
"cwd": "pkgs/edge-worker"
161+
}
162+
},
155163
"test:integration": {
156164
"dependsOn": ["db:ensure", "^build"],
157165
"executor": "nx:run-commands",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {
2+
EdgeWorker,
3+
ProcessPlatformAdapter,
4+
SupabasePlatformAdapter,
5+
} from '../dist/index.js';
6+
7+
const exportsToCheck = {
8+
EdgeWorker,
9+
ProcessPlatformAdapter,
10+
SupabasePlatformAdapter,
11+
};
12+
13+
for (const [name, value] of Object.entries(exportsToCheck)) {
14+
if (value === undefined) {
15+
throw new Error(`Missing Bun smoke export: ${name}`);
16+
}
17+
}
18+
19+
console.log('edge-worker bun dist smoke passed');

0 commit comments

Comments
 (0)