Skip to content

Commit 3ee0ca2

Browse files
committed
ci: gate e2e on a working scriptc, allow workerd build
The runner can resolve a scriptc binary whose coverage spawn fails (Permission denied on tsserver); probe with a real coverage run and skip e2e when it cannot execute. workerd needs its postinstall for the wrangler-action deploy.
1 parent 1b46fec commit 3ee0ca2

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎pnpm-workspace.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ allowBuilds:
22
'@docmd/engine-rust': true
33
esbuild: true
44
scriptc: true
5+
workerd: true
56
minimumReleaseAgeExclude:
67
- scriptc
78
- '@scriptc/*'

‎test/e2e.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ import assert from "node:assert/strict";
66
import { mkdtempSync, writeFileSync, existsSync } from "node:fs";
77
import { tmpdir } from "node:os";
88
import { join } from "node:path";
9-
import { execFileSync } from "node:child_process";
9+
import { execFileSync, spawnSync } from "node:child_process";
1010
import { readDiagnostics, resolveScriptcBin, runScriptc, buildArgs } from "../src/scriptc.ts";
1111

1212
function scriptcAvailable(root: string): boolean {
1313
try {
14-
execFileSync(resolveScriptcBin(root), ["--version"], { stdio: "pipe" });
15-
return true;
14+
const bin = resolveScriptcBin(root);
15+
const probe = join(root, "probe.ts");
16+
writeFileSync(probe, 'console.log("ok");\n');
17+
const r = spawnSync(bin, ["coverage", probe], { encoding: "utf8" });
18+
return r.status === 0;
1619
} catch {
1720
return false;
1821
}

0 commit comments

Comments
 (0)