Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions packages/opencode/test/file/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ describe("file/index Filesystem patterns", () => {
expect(yield* fsys.existsSafe(gitignorePath)).toBe(true)
expect(yield* fsys.readFileString(gitignorePath)).toContain("node_modules")
}),
{ git: true },
)

it.instance(
Expand All @@ -214,7 +213,6 @@ describe("file/index Filesystem patterns", () => {
expect(yield* fsys.existsSafe(ignorePath)).toBe(true)
expect(yield* fsys.readFileString(ignorePath)).toContain("*.log")
}),
{ git: true },
)

it.instance(
Expand All @@ -229,7 +227,6 @@ describe("file/index Filesystem patterns", () => {
const nodes = yield* list()
expect(Array.isArray(nodes)).toBe(true)
}),
{ git: true },
)
})

Expand All @@ -246,7 +243,6 @@ describe("file/index Filesystem patterns", () => {
const content = yield* fsys.readFileString(untrackedPath)
expect(content.split("\n").length).toBe(2)
}),
{ git: true },
)
})

Expand Down Expand Up @@ -519,7 +515,6 @@ describe("file/index Filesystem patterns", () => {
expect(["file", "directory"]).toContain(node.type)
}
}),
{ git: true },
)

it.instance(
Expand All @@ -543,14 +538,14 @@ describe("file/index Filesystem patterns", () => {
expect(dirs.map((dir) => dir.name)).toEqual(dirs.map((dir) => dir.name).toSorted())
expect(files.map((file) => file.name)).toEqual(files.map((file) => file.name).toSorted())
}),
{ git: true },
)

it.instance(
"excludes .git and .DS_Store",
() =>
Effect.gen(function* () {
const test = yield* TestInstance
yield* Effect.promise(() => fs.mkdir(path.join(test.directory, ".git")))
yield* Effect.promise(() => fs.writeFile(path.join(test.directory, ".DS_Store"), "", "utf-8"))
yield* Effect.promise(() => fs.writeFile(path.join(test.directory, "visible.txt"), "", "utf-8"))

Expand All @@ -559,7 +554,6 @@ describe("file/index Filesystem patterns", () => {
expect(names).not.toContain(".DS_Store")
expect(names).toContain("visible.txt")
}),
{ git: true },
)

it.instance(
Expand Down Expand Up @@ -594,7 +588,6 @@ describe("file/index Filesystem patterns", () => {
expect(nodes.map((node) => node.name).sort()).toEqual(["a.txt", "b.txt"])
expect(nodes[0].path.replaceAll("\\", "/").startsWith("sub/")).toBe(true)
}),
{ git: true },
)

it.instance(
Expand All @@ -603,7 +596,6 @@ describe("file/index Filesystem patterns", () => {
Effect.gen(function* () {
expect(yield* failureMessage(list("../outside"))).toContain("Access denied")
}),
{ git: true },
)

it.instance("works without git", () =>
Expand Down Expand Up @@ -632,7 +624,6 @@ describe("file/index Filesystem patterns", () => {
const result = yield* search({ query: "", type: "file" })
expect(result.length).toBeGreaterThan(0)
}),
{ git: true },
)

it.instance(
Expand All @@ -645,7 +636,6 @@ describe("file/index Filesystem patterns", () => {
const result = yield* search({ query: "main", type: "file" })
expect(result.some((file) => file.includes("main"))).toBe(true)
}),
{ git: true },
)

it.instance(
Expand All @@ -668,7 +658,6 @@ describe("file/index Filesystem patterns", () => {
expect(firstHidden).toBeGreaterThan(lastVisible)
}
}),
{ git: true },
)

it.instance(
Expand All @@ -682,7 +671,6 @@ describe("file/index Filesystem patterns", () => {
const result = yield* search({ query: "main", type: "file" })
expect(result.some((file) => file.includes("main"))).toBe(true)
}),
{ git: true },
)

it.instance(
Expand All @@ -698,7 +686,6 @@ describe("file/index Filesystem patterns", () => {
expect(file.endsWith("/")).toBe(false)
}
}),
{ git: true },
)

it.instance(
Expand All @@ -714,7 +701,6 @@ describe("file/index Filesystem patterns", () => {
expect(dir.endsWith("/")).toBe(true)
}
}),
{ git: true },
)

it.instance(
Expand All @@ -728,7 +714,6 @@ describe("file/index Filesystem patterns", () => {
const result = yield* search({ query: "", type: "file", limit: 2 })
expect(result.length).toBeLessThanOrEqual(2)
}),
{ git: true },
)

it.instance(
Expand All @@ -743,7 +728,6 @@ describe("file/index Filesystem patterns", () => {
expect(result.length).toBeGreaterThan(0)
expect(result[0]).toContain(".hidden")
}),
{ git: true },
)

it.instance(
Expand All @@ -759,7 +743,6 @@ describe("file/index Filesystem patterns", () => {

expect(yield* search({ query: "fresh", type: "file" })).toContain("fresh.ts")
}),
{ git: true },
)
})

Expand Down Expand Up @@ -843,9 +826,8 @@ describe("file/index Filesystem patterns", () => {
yield* init()
expect(yield* search({ query: "b.ts", type: "file" })).toContain("b.ts")
expect(yield* search({ query: "a.ts", type: "file" })).not.toContain("a.ts")
}).pipe(withTmpdirInstance({ git: true }))
}).pipe(withTmpdirInstance())
}),
{ git: true },
)

it.instance(
Expand All @@ -866,7 +848,6 @@ describe("file/index Filesystem patterns", () => {
expect(yield* search({ query: "after", type: "file" })).toContain("after.ts")
expect(yield* search({ query: "before", type: "file" })).not.toContain("before.ts")
}),
{ git: true },
)
})
})
1 change: 1 addition & 0 deletions perf/test-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Repeated setup work, long sleeps/timeouts, serial integration tests, filesystem/
| CLI run subprocess cases can run independently | Marked `run-process.test.ts` subprocess cases concurrent | 11.87s | 4.13s | keep | Newest-dev single baseline; after median from three reruns (4.13, 4.17, 4.11). Each case has an isolated temp home and LLM port. |
| Snapshot initialization does not need to commit seeded files in the source repo | Removed extra `git add`/`commit` from the snapshot test `initialize()` helper | 22.22s | 20.23s | keep | Newest-dev single baseline; after median from three reruns (20.23, 22.59, 20.11). Fixture still creates a git repo root commit. |
| Processor AI SDK tool-call case does not assert git behavior | Removed `git: true` from the non-native tool-call processor test | 10.22s | 9.48s | keep | Newest-dev single baseline; full-file after median from three reruns (9.48, 9.60, 9.36); focused case passes in 1.39s. |
| File list/search/cache tests do not assert repository state | Removed `git: true` from non-VCS file service tests while preserving the `.git` exclusion case | 33.00s | 15.98s | keep | Three-run medians for `test/file/index.test.ts`; targeted suite is 17.02s faster (51.6%, 2.06x). |

## Profiling Results

Expand Down
Loading