Skip to content

Commit c82e172

Browse files
committed
harden qa lab config patch replace paths
1 parent d3db468 commit c82e172

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

extensions/qa-lab/src/suite-runtime-gateway.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,25 @@ describe("qa suite gateway helpers", () => {
261261
patchConfig({
262262
env,
263263
patch: { tools: { deny: ["read"] } },
264+
replacePaths: ["tools.deny"],
264265
restartDelayMs: 0,
265266
}),
266267
).resolves.toEqual({ ok: true });
267268

268269
expect(gatewayCall).toHaveBeenCalledWith(
269270
"config.patch",
270-
expect.objectContaining({ baseHash: "hash-1" }),
271+
expect.objectContaining({
272+
baseHash: "hash-1",
273+
replacePaths: ["tools.deny"],
274+
}),
271275
{ timeoutMs: 180_000 },
272276
);
273277
expect(gatewayCall).toHaveBeenCalledWith(
274278
"config.patch",
275-
expect.objectContaining({ baseHash: "hash-2" }),
279+
expect.objectContaining({
280+
baseHash: "hash-2",
281+
replacePaths: ["tools.deny"],
282+
}),
276283
{ timeoutMs: 180_000 },
277284
);
278285
});

extensions/qa-lab/src/suite-runtime-gateway.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ async function runConfigMutation(params: {
241241
};
242242
note?: string;
243243
restartDelayMs?: number;
244+
replacePaths?: readonly string[];
244245
}) {
245246
const restartDelayMs = params.restartDelayMs ?? 1_000;
246247
const timeoutMs = liveTurnTimeoutMs(params.env, 180_000);
@@ -263,6 +264,7 @@ async function runConfigMutation(params: {
263264
...(params.deliveryContext ? { deliveryContext: params.deliveryContext } : {}),
264265
...(params.note ? { note: params.note } : {}),
265266
restartDelayMs,
267+
...(params.replacePaths?.length ? { replacePaths: params.replacePaths } : {}),
266268
},
267269
{ timeoutMs },
268270
);
@@ -316,6 +318,7 @@ async function patchConfig(params: {
316318
};
317319
note?: string;
318320
restartDelayMs?: number;
321+
replacePaths?: readonly string[];
319322
}) {
320323
return await runConfigMutation({
321324
env: params.env,
@@ -325,6 +328,7 @@ async function patchConfig(params: {
325328
deliveryContext: params.deliveryContext,
326329
note: params.note,
327330
restartDelayMs: params.restartDelayMs,
331+
replacePaths: params.replacePaths,
328332
});
329333
}
330334

0 commit comments

Comments
 (0)