fix(test): set OPENCODE_EXPERIMENTAL_WORKSPACES in fence header test (#26466)
This commit is contained in:
@@ -14,17 +14,22 @@ import { disposeAllInstances, tmpdirScoped } from "../fixture/fixture"
|
|||||||
import { testEffect } from "../lib/effect"
|
import { testEffect } from "../lib/effect"
|
||||||
|
|
||||||
// Flip the experimental HttpApi flag so backend selection telemetry on the
|
// Flip the experimental HttpApi flag so backend selection telemetry on the
|
||||||
// production routes reports the right backend, and reset the database around
|
// production routes reports the right backend, and the experimental
|
||||||
// the test so per-instance state does not leak between runs. resetDatabase()
|
// workspaces flag so SyncEvent.run actually writes to EventSequenceTable
|
||||||
// already calls disposeAllInstances(), so we don't repeat it.
|
// (the source of truth the fence middleware reads). Reset the database
|
||||||
|
// around the test so per-instance state does not leak between runs.
|
||||||
|
// resetDatabase() already calls disposeAllInstances(), so we don't repeat it.
|
||||||
const testStateLayer = Layer.effectDiscard(
|
const testStateLayer = Layer.effectDiscard(
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const originalHttpApi = Flag.OPENCODE_EXPERIMENTAL_HTTPAPI
|
const originalHttpApi = Flag.OPENCODE_EXPERIMENTAL_HTTPAPI
|
||||||
|
const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES
|
||||||
Flag.OPENCODE_EXPERIMENTAL_HTTPAPI = true
|
Flag.OPENCODE_EXPERIMENTAL_HTTPAPI = true
|
||||||
|
Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true
|
||||||
yield* Effect.promise(() => resetDatabase())
|
yield* Effect.promise(() => resetDatabase())
|
||||||
yield* Effect.addFinalizer(() =>
|
yield* Effect.addFinalizer(() =>
|
||||||
Effect.promise(async () => {
|
Effect.promise(async () => {
|
||||||
Flag.OPENCODE_EXPERIMENTAL_HTTPAPI = originalHttpApi
|
Flag.OPENCODE_EXPERIMENTAL_HTTPAPI = originalHttpApi
|
||||||
|
Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = originalWorkspaces
|
||||||
await resetDatabase()
|
await resetDatabase()
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user