test(core): refuse network in the test harness (#46908)

This commit is contained in:
Kit Langton
2026-09-02 20:41:29 -04:00
committed by GitHub
parent b257d476c9
commit f34b74b1dc
21 changed files with 167 additions and 11 deletions
+1
View File
@@ -11,6 +11,7 @@ export const startServer = Effect.fnUntraced(function* (directory: string) {
database: { path: ":memory:" },
config: { directory },
fs: { filewatcher: false },
models: { fetch: false },
})
return {
base: HttpServer.formatAddress(server.address),
+1
View File
@@ -47,6 +47,7 @@ it.live("uses base configuration without depending on process.cwd()", () =>
database: { path: ":memory:" },
config: { directory: global },
fs: { filewatcher: false },
models: { fetch: false },
},
{ overrides: [Generate.node.replace(generate)] },
)
@@ -55,7 +55,12 @@ it.live("updates completed assistant message content through the session HTTP AP
}),
)
const handler = yield* ServerFetch.make(
{ app: { version: "test-version" }, database: { path: ":memory:" }, fs: { filewatcher: false } },
{
app: { version: "test-version" },
database: { path: ":memory:" },
fs: { filewatcher: false },
models: { fetch: false },
},
{
overrides: [
SessionExecution.node.replace(
+6 -1
View File
@@ -81,7 +81,12 @@ it.live("maps a failing base provider to HTTP 503 instead of null metadata", ()
Effect.gen(function* () {
const tmp = yield* Effect.acquireDisposable(Effect.promise(() => tmpdir("opencode-vcs-failure-")))
const handler = yield* ServerFetch.make(
{ database: { path: ":memory:" }, config: { directory: tmp.path }, fs: { filewatcher: false } },
{
database: { path: ":memory:" },
config: { directory: tmp.path },
fs: { filewatcher: false },
models: { fetch: false },
},
{
overrides: [
SdkPlugins.node.replace(