Skip to content

Commit 817b887

Browse files
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7wpfleger96
andcommitted
test(file-size): fix fileOverrides integration test under GITHUB_ACTIONS
Add a second empty commit to the temp repo before staging test files so HEAD^1 resolves in CI (where resolveBaseRef returns HEAD^1 as the base). Remove now-unused spawnSync import. Co-authored-by: Will Pfleger <[email protected]> Signed-off-by: Will Pfleger <[email protected]>
1 parent 1e9df55 commit 817b887

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎scripts/check-file-sizes-core.test.mjs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from "node:assert/strict";
2-
import { execFileSync, spawnSync } from "node:child_process";
2+
import { execFileSync } from "node:child_process";
33
import { mkdtempSync, writeFileSync, mkdirSync } from "node:fs";
44
import { tmpdir } from "node:os";
55
import path from "node:path";
@@ -133,6 +133,10 @@ test("fileOverrides raises the ceiling for a named path without leaking to other
133133
gitRepo("remote", "add", "origin", repoRoot);
134134
gitRepo("fetch", "origin", "main:refs/remotes/origin/main");
135135

136+
// Add a second commit so HEAD^1 resolves (the CI path uses HEAD^1 as base,
137+
// and a parentless HEAD causes git cat-file -e HEAD^1^{commit} to throw).
138+
gitRepo("commit", "--allow-empty", "-m", "branch commit");
139+
136140
// Write both files: 1001 lines each (1 over the 1000-line default ceiling)
137141
const content = "x\n".repeat(1001);
138142
writeFileSync(path.join(srcDir, "governed.ts"), content);

0 commit comments

Comments
 (0)