test(coding-agent): disabled fsmonitor during test repo initialization

- Added core.fsmonitor configuration to the git initialization process in test setup to prevent potential environment-specific conflicts.
This commit is contained in:
can1357
2026-06-25 12:53:42 +02:00
parent a13c8d2698
commit c03a78917a
3 changed files with 22 additions and 4 deletions
@@ -83,7 +83,7 @@ let templateBaselineCommit: string;
beforeAll(async () => {
templateRepo = makeTempDir("@pi-autoresearch-template-");
await Bun.write(path.join(templateRepo.path(), "README.md"), "# baseline\n");
await $`git init --initial-branch=main && git config core.autocrlf false && git config user.email tester@example.com && git config user.name Tester && git add -A && git commit -m baseline`
await $`git init --initial-branch=main && git config core.autocrlf false && git config core.fsmonitor false && git config user.email tester@example.com && git config user.name Tester && git add -A && git commit -m baseline`
.cwd(templateRepo.path())
.quiet();
templateBaselineCommit = (await $`git rev-parse HEAD`.cwd(templateRepo.path()).text()).trim();
@@ -1,4 +1,4 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "bun:test";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from "bun:test";
import * as fs from "node:fs/promises";
import * as os from "node:os";
import * as path from "node:path";
@@ -37,6 +37,24 @@ describe("streaming edit preview height (stable, full tail window)", () => {
let file: string;
let themed = false;
// The streaming edit window is sized as min(EDIT_STREAMING_PREVIEW_LINES,
// previewWindowRows()), and previewWindowRows() reads process.stdout.rows.
// Pin a tall, stable viewport so the "full window of real diff" height
// assertions don't shrink (and flake) under a short ambient terminal when the
// file runs inside the full suite. Restored in afterAll.
let originalRowsDescriptor: PropertyDescriptor | undefined;
beforeAll(() => {
originalRowsDescriptor = Object.getOwnPropertyDescriptor(process.stdout, "rows");
Object.defineProperty(process.stdout, "rows", { value: 50, configurable: true });
});
afterAll(() => {
if (originalRowsDescriptor) {
Object.defineProperty(process.stdout, "rows", originalRowsDescriptor);
} else {
delete (process.stdout as { rows?: number }).rows;
}
});
beforeEach(async () => {
if (!themed) {
await initTheme();
+2 -2
View File
@@ -168,10 +168,10 @@ describe("agent_type migration backfill", () => {
cost_input, cost_output, cost_cache_read, cost_cache_write, cost_total
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`);
for (const file of [mainFile, subFile, advisorFile]) {
for (const [index, file] of [mainFile, subFile, advisorFile].entries()) {
insert.run(
file,
"e1",
`e${index + 1}`,
"/work/pi",
"claude-sonnet-4.5",
"anthropic",