Skip to content

Commit 78fde53

Browse files
t3dotggclaude
andcommitted
fix(ci): run the shard weights script through the package's own vp
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 6f0fe52 commit 78fde53

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/server/scripts/update-test-shard-weights.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ const weightsPath = NodePath.join(serverDir, "src/testUtils/shardWeights.json");
2727
const reportDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-server-test-report-"));
2828
const reportPath = NodePath.join(reportDir, "report.json");
2929

30-
// Failing tests still report their duration, so the exit code is not checked.
31-
NodeChildProcess.spawnSync("vp", ["test", "run", "--reporter=json", `--outputFile=${reportPath}`], {
32-
cwd: serverDir,
33-
stdio: "inherit",
34-
});
30+
// `node --run` puts the package's own `vp` on PATH, on every platform. Failing
31+
// tests still report their duration, so the exit code is not checked.
32+
NodeChildProcess.spawnSync(
33+
process.execPath,
34+
["--run", "test", "--", "--reporter=json", `--outputFile=${reportPath}`],
35+
{ cwd: serverDir, stdio: "inherit" },
36+
);
3537

3638
const report: VitestJsonReport = JSON.parse(NodeFS.readFileSync(reportPath, "utf8"));
3739
NodeFS.rmSync(reportDir, { recursive: true, force: true });
@@ -50,4 +52,3 @@ const weights = Object.fromEntries(
5052
);
5153

5254
NodeFS.writeFileSync(weightsPath, `${JSON.stringify(weights, null, 2)}\n`);
53-
NodeChildProcess.spawnSync("vp", ["fmt", weightsPath], { cwd: serverDir, stdio: "inherit" });

0 commit comments

Comments
 (0)