mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-24 00:09:52 +00:00
fix(update): suppress handoff newer-config warning (#81235)
Merged via squash.
Prepared head SHA: 61a5c975bf
Co-authored-by: giodl73-repo <giodl@microsoft.com>
Co-authored-by: galiniliev <5711535+galiniliev@users.noreply.github.com>
Reviewed-by: @galiniliev
This commit is contained in:
@@ -8,6 +8,7 @@ const classifyPortListener = vi.hoisted(() =>
|
||||
vi.fn<(_listener: unknown, _port: number) => PortListenerKind>(() => "gateway"),
|
||||
);
|
||||
const probeGateway = vi.hoisted(() => vi.fn());
|
||||
const createConfigIO = vi.hoisted(() => vi.fn());
|
||||
const readBestEffortConfig = vi.hoisted(() => vi.fn(async () => ({})));
|
||||
const resolveGatewayProbeAuthSafeWithSecretInputs = vi.hoisted(() =>
|
||||
vi.fn<(_opts: unknown) => Promise<{ auth: { token?: string; password?: string } }>>(async () => ({
|
||||
@@ -26,9 +27,7 @@ vi.mock("../../gateway/probe.js", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../../config/io.js", () => ({
|
||||
createConfigIO: () => ({
|
||||
readBestEffortConfig: () => readBestEffortConfig(),
|
||||
}),
|
||||
createConfigIO: (opts: unknown) => createConfigIO(opts),
|
||||
}));
|
||||
|
||||
vi.mock("../../gateway/probe-auth.js", () => ({
|
||||
@@ -139,6 +138,10 @@ describe("inspectGatewayRestart", () => {
|
||||
inspectPortUsage.mockReset();
|
||||
readBestEffortConfig.mockReset();
|
||||
readBestEffortConfig.mockResolvedValue({});
|
||||
createConfigIO.mockReset();
|
||||
createConfigIO.mockReturnValue({
|
||||
readBestEffortConfig: () => readBestEffortConfig(),
|
||||
});
|
||||
resolveGatewayProbeAuthSafeWithSecretInputs.mockReset();
|
||||
resolveGatewayProbeAuthSafeWithSecretInputs.mockResolvedValue({ auth: {} });
|
||||
inspectPortUsage.mockResolvedValue({
|
||||
@@ -442,6 +445,13 @@ describe("inspectGatewayRestart", () => {
|
||||
expect(authResolveInput.cfg?.gateway?.auth?.mode).toBe("token");
|
||||
expect(authResolveInput.cfg?.gateway?.auth?.token).toBe("probe-token");
|
||||
expect(authResolveInput.mode).toBe("local");
|
||||
expect(createConfigIO).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
env: serviceEnv,
|
||||
pluginValidation: "skip",
|
||||
suppressFutureVersionWarning: true,
|
||||
}),
|
||||
);
|
||||
const probeInput = firstCallArg(probeGateway) as {
|
||||
auth?: { token?: string; password?: string };
|
||||
env?: NodeJS.ProcessEnv;
|
||||
@@ -637,6 +647,8 @@ describe("inspectGatewayRestart", () => {
|
||||
});
|
||||
|
||||
it("annotates stopped-free early exits with the actual elapsed time", async () => {
|
||||
Object.defineProperty(process, "platform", { value: "linux", configurable: true });
|
||||
|
||||
const snapshot = await waitForStoppedFreeGatewayRestart();
|
||||
|
||||
expect(snapshot.healthy).toBe(false);
|
||||
|
||||
@@ -274,6 +274,7 @@ async function resolveGatewayRestartProbeAuth(
|
||||
const cfg = await createConfigIO({
|
||||
env: mergedEnv,
|
||||
pluginValidation: "skip",
|
||||
suppressFutureVersionWarning: true,
|
||||
})
|
||||
.readBestEffortConfig()
|
||||
.catch((): OpenClawConfig => ({}));
|
||||
|
||||
Reference in New Issue
Block a user