mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-31 03:52:34 +00:00
fix(perf): preserve gateway health benchmark auth
This commit is contained in:
@@ -532,12 +532,19 @@ function collectExitSummary(samples: Sample[]): string {
|
||||
}
|
||||
|
||||
function buildConfigFixture(commandCase: CommandCase): Record<string, unknown> | null {
|
||||
if (commandCase.id !== "configGetGatewayPort") {
|
||||
if (commandCase.id !== "configGetGatewayPort" && commandCase.id !== "gatewayHealthJson") {
|
||||
return null;
|
||||
}
|
||||
const envPort = Number.parseInt(process.env.OPENCLAW_GATEWAY_PORT ?? "", 10);
|
||||
const port = Number.isFinite(envPort) && envPort > 0 ? envPort : 32123;
|
||||
return { gateway: { port } };
|
||||
return {
|
||||
gateway: {
|
||||
auth: { mode: "none" },
|
||||
bind: "loopback",
|
||||
mode: "local",
|
||||
port,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function buildRssHook(tmpDir: string): string {
|
||||
|
||||
@@ -171,7 +171,14 @@ describe("bench-cli-startup", () => {
|
||||
args: ["config", "get", "gateway.port"],
|
||||
presets: ["real"],
|
||||
}),
|
||||
).toEqual({ gateway: { port: 32123 } });
|
||||
).toEqual({
|
||||
gateway: {
|
||||
auth: { mode: "none" },
|
||||
bind: "loopback",
|
||||
mode: "local",
|
||||
port: 32123,
|
||||
},
|
||||
});
|
||||
expect(
|
||||
testing.buildConfigFixture({
|
||||
id: "gatewayHealthJson",
|
||||
@@ -179,6 +186,13 @@ describe("bench-cli-startup", () => {
|
||||
args: ["gateway", "health", "--json"],
|
||||
presets: ["real"],
|
||||
}),
|
||||
).toBeNull();
|
||||
).toEqual({
|
||||
gateway: {
|
||||
auth: { mode: "none" },
|
||||
bind: "loopback",
|
||||
mode: "local",
|
||||
port: 32123,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user