Skip to content

Commit 5915cb9

Browse files
committed
test(server): fold unreadable-secret reconcile case into existing tests
Signed-off-by: Yordis Prieto <[email protected]>
1 parent 701b431 commit 5915cb9

1 file changed

Lines changed: 3 additions & 24 deletions

File tree

‎apps/server/src/provider/ProviderInstanceRegistry.test.ts‎

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -899,43 +899,22 @@ describe("ProviderInstanceRegistry secret environment", () => {
899899
it.effect("marks an instance unavailable and names the variable it could not read", () => {
900900
const fixture = setup({});
901901
return Effect.gen(function* () {
902-
const { registry } = yield* fixture.make;
902+
const { registry, mutator } = yield* fixture.make;
903+
const readsAtStartup = fixture.reads.length;
903904

904905
expect(yield* registry.getInstance(instanceId)).toBeUndefined();
905906
expect(fixture.created).toEqual([]);
906907
const [unavailable] = yield* registry.listUnavailable;
907908
expect(unavailable?.instanceId).toBe(instanceId);
908909
expect(unavailable?.unavailableReason).toContain("OPENAI_API_KEY");
909-
}).pipe(Effect.scoped);
910-
});
911-
912-
it.effect("does not read an unreadable secret again when a settings save leaves it alone", () => {
913-
const fixture = setup({});
914-
return Effect.gen(function* () {
915-
const { registry, mutator } = yield* fixture.make;
916-
const readsAtStartup = fixture.reads.length;
917910

911+
// A settings save that leaves it alone does not read the vault again.
918912
yield* mutator.reconcile({ ...fixture.configMap });
919-
920913
expect(fixture.reads).toHaveLength(readsAtStartup);
921914
expect(yield* registry.listUnavailable).toHaveLength(1);
922915
}).pipe(Effect.scoped);
923916
});
924917

925-
it.effect("starts an unreadable instance once a refresh can read its secret", () => {
926-
const fixture = setup({});
927-
return Effect.gen(function* () {
928-
const { registry, mutator } = yield* fixture.make;
929-
yield* mutator.reconcile({ ...fixture.configMap });
930-
931-
fixture.vault.set(secret.reference, "sk-live");
932-
yield* mutator.reloadSecrets();
933-
934-
expect(yield* registry.getInstance(instanceId)).toBeDefined();
935-
expect(yield* registry.listUnavailable).toEqual([]);
936-
}).pipe(Effect.scoped);
937-
});
938-
939918
it.effect("does not read the secrets of an instance its config decodes as disabled", () => {
940919
const fixture = setup({ [secret.reference]: "sk-live" }, DisabledByDefaultConfig);
941920
return Effect.gen(function* () {

0 commit comments

Comments
 (0)