test: migrate fixture layer replacements (#46458)

Update the Core compile options and Server replacement values to the current LayerNode API. Preserve test expectations, replacement targets, and layer lifetimes.
This commit is contained in:
Kit Langton 2026-08-31 14:16:40 -04:00 committed by GitHub
parent 3e9b009642
commit 1f04baa684
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 14 deletions

View file

@ -1374,7 +1374,9 @@ function buildExecution(
Layer.provide(Layer.succeed(Job.Service, jobs)),
// Do not reuse the outer harness's selector with its already-captured Location map.
Layer.provide(
LayerNode.compile(Instance.byLocationNode, [[LocationServiceMap.node, locations]]).pipe(Layer.fresh),
LayerNode.compile(Instance.byLocationNode, {
replacements: [LocationServiceMap.node.replace(locations)],
}).pipe(Layer.fresh),
),
),
scope,

View file

@ -52,18 +52,19 @@ it.live(
const cell = PluginRuntime.makeCell()
// Host and private instances must reuse the same global layer identities.
const replacements: LayerNode.Replacements = [
[Global.node, tempGlobalLayer],
[Database.node, Database.node],
[Bus.node, Bus.node],
[App.node, App.node],
[ModelsDev.node, ModelsDev.configured({ fetch: false })],
[Watcher.node, Watcher.configured({ enabled: false })],
[PluginRuntime.node, PluginRuntime.layerWithCell(cell)],
[PluginRuntime.providerNode, PluginRuntime.providerNodeWithCell(cell)],
[llmClient, Layer.succeed(LLMClient.Service, llm)],
[SessionRunnerModel.node, Layer.succeed(SessionRunnerModel.Service, { resolve: () => Effect.succeed(model) })],
[
Instance.byLocationNode,
Global.node.replace(tempGlobalLayer),
Database.node.replace(Database.node),
Bus.node.replace(Bus.node),
App.node.replace(App.node),
ModelsDev.node.replace(ModelsDev.configured({ fetch: false })),
Watcher.node.replace(Watcher.configured({ enabled: false })),
PluginRuntime.node.replace(PluginRuntime.layerWithCell(cell)),
PluginRuntime.providerNode.replace(PluginRuntime.providerNodeWithCell(cell)),
llmClient.replace(Layer.succeed(LLMClient.Service, llm)),
SessionRunnerModel.node.replace(
Layer.succeed(SessionRunnerModel.Service, { resolve: () => Effect.succeed(model) }),
),
Instance.byLocationNode.replace(
Layer.effect(
Instance.Service,
Effect.gen(function* () {
@ -151,7 +152,7 @@ it.live(
})
}),
),
],
),
]
const context = yield* Layer.build(
createEmbeddedRoutes({}, replacements).pipe(Layer.provide(HttpServer.layerServices)),