Speed up targeted opencode tests

Reduce avoidable setup costs in slow opencode tests while preserving reviewed coverage and recording the benchmark evidence for follow-up test-suite work.
This commit is contained in:
Kit Langton
2026-05-18 12:18:29 -04:00
committed by GitHub
parent 0a945219a9
commit 896ad7b884
18 changed files with 737 additions and 575 deletions

View File

@@ -265,7 +265,7 @@ function withProject<A, E, E2 = never>(
) {
return Effect.gen(function* () {
const directory = yield* tmpdirScoped({
git: options.git ?? true,
git: options.git ?? false,
config: { formatter: false, lsp: false, ...options.config },
})
yield* options.setup?.(directory) ?? Effect.void
@@ -516,7 +516,7 @@ describe("HttpApi SDK", () => {
)
serverPathParity("matches generated SDK instance read routes", (serverPath) =>
withStandardProject(serverPath, ({ sdk, directory }) =>
withProject(serverPath, { git: true, setup: writeStandardFiles }, ({ sdk, directory }) =>
Effect.gen(function* () {
const project = yield* capture(() => sdk.project.current())
const projects = yield* capture(() => sdk.project.list())
@@ -561,6 +561,7 @@ describe("HttpApi SDK", () => {
foundFile: JSON.stringify(findFiles.data).includes("hello.txt"),
foundText: JSON.stringify(findText.data ?? null).includes("sdk-parity"),
listedFile: JSON.stringify(files.data).includes("hello.txt"),
vcs: { hasBranch: typeof record(vcs.data).branch === "string" },
}
}),
),
@@ -887,7 +888,7 @@ describe("HttpApi SDK", () => {
)
serverPathParity("matches generated SDK project git initialization", (serverPath) =>
withProject(serverPath, { git: false }, ({ sdk, directory }) =>
withProject(serverPath, {}, ({ sdk, directory }) =>
Effect.gen(function* () {
const before = yield* capture(() => sdk.project.current())
const init = yield* capture(() => sdk.project.initGit())