GeezerVison is showing github.com — test(upstream-fixes): fork ingestor tests provide upstream's GitVcsDr… · RSI-Software/t3code-hyprws@f98d5bc
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/ProviderSessionManager.fork.test.ts +18-7Lines changed: 18 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,8 +43,11 @@ import * as ServerEnvironment from "../environment/ServerEnvironment.ts"; | 43 | 43 | import * as McpProviderSessions from "@t3tools/provider-core/server/McpProviderSessions"; | 44 | 44 | import * as McpSessionRegistry from "../mcp/McpSessionRegistry.ts"; | 45 | 45 | import * as SqlitePersistence from "../persistence/Sqlite.ts"; | | 46 | +import * as GitVcsDriver from "../vcs/GitVcsDriver.ts"; | | 47 | +import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts"; | 46 | 48 | import * as ServerSettings from "../serverSettings.ts"; | 47 | 49 | import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts"; | | 50 | +import * as CommandOutputHub from "./CommandOutputHub.ts"; | 48 | 51 | import * as EventSink from "./EventSink.ts"; | 49 | 52 | import * as EventStore from "./EventStore.ts"; | 50 | 53 | import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator"; | @@ -115,7 +118,7 @@ const layerFlakyProjectionReads = (flaky: FlakyProjectionReads) => | 115 | 118 | Effect.gen(function* () { | 116 | 119 | if (yield* Ref.getAndSet(flaky.armed, false)) { | 117 | 120 | yield* Queue.offer(flaky.failures, undefined); | 118 | | - return yield* Effect.fail(new ProjectionStore.ProjectionStoreReadError({ threadId })); | | 121 | + return yield* new ProjectionStore.ProjectionStoreReadError({ threadId }); | 119 | 122 | } | 120 | 123 | return yield* delegate.getThreadRecords(threadId, fields, filter); | 121 | 124 | }); | @@ -211,12 +214,10 @@ const layerTest = (input: { | 211 | 214 | startTurn: () => Effect.die("unused"), | 212 | 215 | steerTurn: () => Effect.void, | 213 | 216 | interruptTurn: ({ providerTurnId }) => | 214 | | - Effect.gen(function* () { | 215 | | - yield* Ref.update(input.state, (current) => ({ | 216 | | - ...current, | 217 | | - interruptedTurnIds: [...current.interruptedTurnIds, providerTurnId], | 218 | | - })); | 219 | | - }), | | 217 | + Ref.update(input.state, (current) => ({ | | 218 | + ...current, | | 219 | + interruptedTurnIds: [...current.interruptedTurnIds, providerTurnId], | | 220 | + })), | 220 | 221 | unloadThread: ({ providerThread }) => | 221 | 222 | Effect.gen(function* () { | 222 | 223 | yield* Ref.update(input.state, (current) => ({ | @@ -253,6 +254,13 @@ const layerTest = (input: { | 253 | 254 | IdAllocator.layer, | 254 | 255 | layerTestStores, | 255 | 256 | ThreadCommandExecutor.layer, | | 257 | + Layer.mock(ProviderInstanceRegistry.ProviderInstanceRegistry)({ | | 258 | + // @effect-diagnostics-next-line effectSucceedWithVoid:off - Optional instances require undefined rather than void. | | 259 | + getInstance: () => Effect.succeed(undefined), | | 260 | + }), | | 261 | + Layer.mock(GitVcsDriver.GitVcsDriver)({ | | 262 | + resolveBranchName: () => Effect.succeed(null), | | 263 | + }), | 256 | 264 | ), | 257 | 265 | ), | 258 | 266 | ); | @@ -268,6 +276,9 @@ const layerTest = (input: { | 268 | 276 | ProviderAdapterRegistry.layerFromAdapters([adapter]).pipe( | 269 | 277 | Layer.provideMerge(McpProviderSessions.layer), | 270 | 278 | ), | | 279 | + CommandOutputHub.layer.pipe( | | 280 | + Layer.provide(Layer.merge(layerConfiguredEventSink, layerTestStores)), | | 281 | + ), | 271 | 282 | layerConfiguredEventSink, | 272 | 283 | IdAllocator.layer, | 273 | 284 | layerProviderEventIngestorTest, | |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/RunExecutionService.ownerFence.fork.test.ts +12-1Lines changed: 12 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -32,7 +32,10 @@ import * as Ref from "effect/Ref"; | 32 | 32 | import * as Stream from "effect/Stream"; | 33 | 33 |
| 34 | 34 | import * as SqlitePersistence from "../persistence/Sqlite.ts"; | | 35 | +import * as GitVcsDriver from "../vcs/GitVcsDriver.ts"; | | 36 | +import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts"; | 35 | 37 | import * as McpAppModelContext from "../mcpApps/McpAppModelContext.ts"; | | 38 | +import * as PreviewAgentActivity from "../preview/PreviewAgentActivity.ts"; | 36 | 39 | import * as ServerSettings from "../serverSettings.ts"; | 37 | 40 | import * as CheckpointService from "./CheckpointService.ts"; | 38 | 41 | import * as EventSink from "./EventSink.ts"; | @@ -348,6 +351,13 @@ function fixture(gate: "snapshot" | "cascade" | "nested" | "model") { | 348 | 351 | ingestionProjections, | 349 | 352 | IdAllocator.layer, | 350 | 353 | ThreadCommandExecutor.layer, | | 354 | + Layer.mock(ProviderInstanceRegistry.ProviderInstanceRegistry)({ | | 355 | + // @effect-diagnostics-next-line effectSucceedWithVoid:off - Optional instances require undefined rather than void. | | 356 | + getInstance: () => Effect.succeed(undefined), | | 357 | + }), | | 358 | + Layer.mock(GitVcsDriver.GitVcsDriver)({ | | 359 | + resolveBranchName: () => Effect.succeed(null), | | 360 | + }), | 351 | 361 | ), | 352 | 362 | ), | 353 | 363 | ); | @@ -358,6 +368,7 @@ function fixture(gate: "snapshot" | "cascade" | "nested" | "model") { | 358 | 368 | ingestion, | 359 | 369 | IdAllocator.layer, | 360 | 370 | McpAppModelContext.layerEmpty, | | 371 | + PreviewAgentActivity.layer, | 361 | 372 | ServerSettings.layerTest(), | 362 | 373 | Layer.mock(TurnItemPositionStore.TurnItemPositionStoreV2)({ | 363 | 374 | allocate: () => Effect.succeed(1), | @@ -474,7 +485,7 @@ function fixture(gate: "snapshot" | "cascade" | "nested" | "model") { | 474 | 485 | const send = (event: ProviderAdapterV2Event) => | 475 | 486 | publish(event).pipe( | 476 | 487 | Effect.flatMap((acks) => | 477 | | - Effect.all([...acks.values()].map(Deferred.await), { concurrency: "unbounded" }), | | 488 | + Effect.forEach([...acks.values()], Deferred.await, { concurrency: "unbounded" }), | 478 | 489 | ), | 479 | 490 | ); | 480 | 491 | return { start, publish, send, projections, history, sink, entered, release, closures, closed }; | |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/RunExecutionService.transfer.fork.test.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,6 +42,7 @@ import type { | 42 | 42 | } from "@t3tools/provider-core/server/ProviderAdapter"; | 43 | 43 | import * as ProjectionStore from "./ProjectionStore.ts"; | 44 | 44 | import * as ProviderEventIngestor from "./ProviderEventIngestor.ts"; | | 45 | +import * as GitVcsDriver from "../vcs/GitVcsDriver.ts"; | 45 | 46 | import * as RunExecutionService from "./RunExecutionService.ts"; | 46 | 47 | import * as TurnItemPositionStore from "./TurnItemPositionStore.ts"; | 47 | 48 | import * as ThreadCommandExecutor from "./ThreadCommandExecutor.ts"; | @@ -285,6 +286,9 @@ function twoSubscriptions( | 285 | 286 | Effect.succeed({ nodes: [], turnItems: [], runtimeRequests: [] }), | 286 | 287 | }), | 287 | 288 | Layer.mock(ThreadCommandExecutor.ThreadCommandExecutor)({}), | | 289 | + Layer.mock(GitVcsDriver.GitVcsDriver)({ | | 290 | + resolveBranchName: () => Effect.succeed(null), | | 291 | + }), | 288 | 292 | ), | 289 | 293 | ), | 290 | 294 | ); | |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/zmux/CheckoutSessionStateLease.fork.test.ts +14-1Lines changed: 14 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,6 +26,8 @@ import * as ProjectStore from "../orchestration-v2/ProjectStore.ts"; | 26 | 26 | import * as ProviderEventIngestor from "../orchestration-v2/ProviderEventIngestor.ts"; | 27 | 27 | import * as ThreadCommandExecutor from "../orchestration-v2/ThreadCommandExecutor.ts"; | 28 | 28 | import * as SqlitePersistence from "../persistence/Sqlite.ts"; | | 29 | +import * as GitVcsDriver from "../vcs/GitVcsDriver.ts"; | | 30 | +import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts"; | 29 | 31 | import * as ProjectEnrichment from "../project/ProjectEnrichmentService.ts"; | 30 | 32 | import * as ProjectService from "../project/ProjectService.ts"; | 31 | 33 | import * as ServerSettings from "../serverSettings.ts"; | @@ -62,7 +64,18 @@ const dependencies = Layer.merge(core, LegacyImporter.layer.pipe(Layer.provide(c | 62 | 64 | const testLayer = Layer.mergeAll( | 63 | 65 | dependencies, | 64 | 66 | ProjectService.layer.pipe(Layer.provide(dependencies)), | 65 | | - ProviderEventIngestor.layer.pipe(Layer.provide(dependencies)), | | 67 | + ProviderEventIngestor.layer.pipe( | | 68 | + Layer.provide(dependencies), | | 69 | + Layer.provide( | | 70 | + Layer.mock(ProviderInstanceRegistry.ProviderInstanceRegistry)({ | | 71 | + // @effect-diagnostics-next-line effectSucceedWithVoid:off - Optional instances require undefined rather than void. | | 72 | + getInstance: () => Effect.succeed(undefined), | | 73 | + }), | | 74 | + ), | | 75 | + Layer.provide( | | 76 | + Layer.mock(GitVcsDriver.GitVcsDriver)({ resolveBranchName: () => Effect.succeed(null) }), | | 77 | + ), | | 78 | + ), | 66 | 79 | ); | 67 | 80 |
| 68 | 81 | it.effect("ordinary mutations remain concurrent; pending cleanup excludes later mutations", () => | |
|