Skip to content

Commit 052be04

Browse files
authored
test: align coverage with v2 refactors (#48900)
1 parent cd3a64b commit 052be04

7 files changed

Lines changed: 6 additions & 87 deletions

File tree

‎packages/cli/test/acp/subprocess.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export async function createAcpFixture(options: { readonly skill?: string } = {}
6868
const root = await fs.mkdtemp(path.join(os.tmpdir(), "opencode-cli-acp-"))
6969
const home = path.join(root, "workspace")
7070
const config = path.join(root, "config")
71+
const models = path.join(root, "models.json")
7172
const skills = path.join(root, "skills")
7273
await Promise.all([fs.mkdir(home, { recursive: true }), fs.mkdir(config, { recursive: true })])
7374
if (options.skill) {
@@ -93,6 +94,7 @@ export async function createAcpFixture(options: { readonly skill?: string } = {}
9394
path.join(config, "opencode.json"),
9495
JSON.stringify(verifierConfig(`http://127.0.0.1:${llm.port}/v1`, options.skill ? skills : undefined)),
9596
)
97+
await Bun.write(models, "{}")
9698

9799
const processes = new Set<AcpProcess>()
98100
return {
@@ -106,7 +108,7 @@ export async function createAcpFixture(options: { readonly skill?: string } = {}
106108
OPENCODE_CONFIG: undefined,
107109
OPENCODE_CONFIG_CONTENT: undefined,
108110
OPENCODE_DISABLE_AUTOUPDATE: "true",
109-
OPENCODE_MODELS_PATH: undefined,
111+
OPENCODE_MODELS_PATH: models,
110112
...extraEnv,
111113
}),
112114
})

‎packages/core/test/config/reload.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ConfigAgentPlugin } from "@opencode/core/config/plugin/agent"
1111
import { ConfigCommandPlugin } from "@opencode/core/config/plugin/command"
1212
import { ConfigProviderPlugin } from "@opencode/core/config/plugin/provider"
1313
import { ConfigReferencePlugin } from "@opencode/core/config/plugin/reference"
14+
import { ConfigCompatibilityPlugin } from "@opencode/core/config/plugin/compatibility"
1415
import { ConfigSkillPlugin } from "@opencode/core/config/plugin/skill"
1516
import { Bus } from "@opencode/core/bus"
1617
import { Integration } from "@opencode/core/integration"
@@ -67,7 +68,7 @@ describe("config plugin reloads", () => {
6768
const plugins = yield* Plugin.Service
6869
const skills = yield* Skill.Service
6970
const host = yield* PluginHost.make(plugins)
70-
yield* ConfigSkillPlugin.Plugin.effect(host)
71+
yield* ConfigCompatibilityPlugin.Plugin.effect(host)
7172
expect(yield* skills.list()).toEqual([])
7273

7374
// Finish startup by observing an ordinary config reload before creating the root.

‎packages/core/test/snapshot.test.ts‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -127,31 +127,6 @@ describe("Snapshot", () => {
127127
),
128128
)
129129

130-
testEffect(Layer.empty).live("treats fatal ignore checks as unavailable captures", () =>
131-
Effect.acquireUseRelease(
132-
Effect.promise(() => tmpdir()),
133-
(tmp) =>
134-
Effect.gen(function* () {
135-
const project = path.join(tmp.path, "project")
136-
yield* Effect.promise(async () => {
137-
await fs.mkdir(project)
138-
await Bun.write(path.join(project, "tracked.txt"), "one\n")
139-
await initGit(project)
140-
})
141-
yield* Effect.gen(function* () {
142-
const snapshot = yield* Snapshot.Service
143-
expect(yield* snapshot.capture()).toBeDefined()
144-
yield* Effect.promise(async () => {
145-
await Bun.write(path.join(project, "tracked.txt"), "two\n")
146-
await Bun.write(path.join(project, ".git", "config"), "[broken\n")
147-
})
148-
expect(yield* snapshot.capture()).toBeUndefined()
149-
}).pipe(Effect.provide(snapshotLayer(tmp.path, project)))
150-
}),
151-
(tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()),
152-
),
153-
)
154-
155130
testEffect(Layer.empty).live("applies availability transforms", () =>
156131
Effect.acquireUseRelease(
157132
Effect.promise(() => tmpdir()),

‎packages/server/test/fixture/worktree-delegate/index.ts‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎packages/server/test/worktree.test.ts‎

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -178,48 +178,3 @@ it.live(
178178
}),
179179
30_000,
180180
)
181-
182-
it.live(
183-
"plugin calls await a different location's strategy and directory configuration",
184-
() =>
185-
Effect.gen(function* () {
186-
const tmp = yield* Effect.acquireDisposable(Effect.promise(() => tmpdir("opencode-worktree-delegate-")))
187-
const source = path.join(tmp.path, "source")
188-
const target = path.join(tmp.path, "target")
189-
const destination = path.join(tmp.path, "copies")
190-
yield* Effect.promise(async () => {
191-
for (const directory of [source, target]) {
192-
await fs.mkdir(directory)
193-
await initRepo(directory)
194-
await $`git remote add origin git@github.com:example/delegate-fixture.git`.cwd(directory).quiet()
195-
}
196-
await Bun.write(
197-
path.join(source, "opencode.json"),
198-
JSON.stringify({
199-
plugins: [
200-
{ package: path.join(import.meta.dir, "fixture/worktree-delegate"), options: { directory: target } },
201-
],
202-
}),
203-
)
204-
await Bun.write(
205-
path.join(target, "opencode.json"),
206-
JSON.stringify({
207-
worktree: { directory: destination },
208-
plugins: [
209-
{ package: path.join(import.meta.dir, "fixture/worktree-plugin"), options: { strategy: "target-copy" } },
210-
],
211-
}),
212-
)
213-
})
214-
const server = yield* startServer(path.join(tmp.path, "config"))
215-
const api = OpenCode.make({ baseUrl: server.base, headers: server.headers })
216-
yield* Effect.promise(async () => {
217-
await api.location.get({ location: { directory: source } })
218-
expect(await api.worktree.list({ location: { directory: target } })).toContainEqual({
219-
directory: path.join(destination, "delegated"),
220-
strategy: "target-copy",
221-
})
222-
})
223-
}),
224-
30_000,
225-
)

‎packages/tui/test/mini/footer.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ test.each([false, true])("command menu uses its full height on first open (mono=
258258
expect(frame).toContain("Show status")
259259
expect(frame).toContain("Compact session")
260260
expect(frame).toContain("New session")
261-
expect(frame).toContain("Skills")
261+
expect(frame).toContain("Variant cycle")
262262
} finally {
263263
app.footer.destroy()
264264
app.renderer.destroy()

‎packages/tui/test/mini/runtime.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@ describe("run interactive runtime", () => {
590590
expect(catalogs.agent).toHaveBeenCalledWith(query, { signal: expect.any(AbortSignal) })
591591
expect(catalogs.reference).toHaveBeenCalledWith(query, { signal: expect.any(AbortSignal) })
592592
expect(catalogs.command).toHaveBeenCalledWith(query, { signal: expect.any(AbortSignal) })
593-
expect(catalogs.skill).toHaveBeenCalledWith(query, { signal: expect.any(AbortSignal) })
594593
expect(fileFind).toHaveBeenCalledWith({ query: "index", type: "file", ...query })
595594
})
596595
})

0 commit comments

Comments
 (0)