mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 17:53:39 +00:00
fix(docker): keep upgrade survivor auto-auth summary safe
This commit is contained in:
parent
e56fd1dc04
commit
0f67474251
2 changed files with 23 additions and 1 deletions
|
|
@ -372,6 +372,7 @@ echo "Verifying config and state survived update..."
|
|||
node scripts/e2e/lib/upgrade-survivor/assertions.mjs assert-config
|
||||
node scripts/e2e/lib/upgrade-survivor/assertions.mjs assert-state
|
||||
|
||||
startup_summary="n/a"
|
||||
if [ "$UPDATE_RESTART_MODE" = "auto-auth" ]; then
|
||||
echo "Gateway restart was handled by openclaw update."
|
||||
else
|
||||
|
|
@ -387,6 +388,7 @@ else
|
|||
openclaw_e2e_print_log "$GATEWAY_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
startup_summary="${start_seconds}s"
|
||||
fi
|
||||
|
||||
echo "Checking gateway HTTP probes..."
|
||||
|
|
@ -428,5 +430,5 @@ if [ "$status_seconds" -gt "$STATUS_BUDGET" ]; then
|
|||
fi
|
||||
node scripts/e2e/lib/upgrade-survivor/assertions.mjs assert-status-json /tmp/openclaw-upgrade-survivor-status.json
|
||||
|
||||
echo "Upgrade survivor Docker E2E passed scenario=${OPENCLAW_UPGRADE_SURVIVOR_SCENARIO:-base} updateRestartMode=${UPDATE_RESTART_MODE} startup=${start_seconds}s status=${status_seconds}s."
|
||||
echo "Upgrade survivor Docker E2E passed scenario=${OPENCLAW_UPGRADE_SURVIVOR_SCENARIO:-base} updateRestartMode=${UPDATE_RESTART_MODE} startup=${startup_summary} status=${status_seconds}s."
|
||||
'
|
||||
|
|
|
|||
|
|
@ -2342,6 +2342,26 @@ fi
|
|||
);
|
||||
});
|
||||
|
||||
it("keeps upgrade survivor auto-auth success summary set -u safe", () => {
|
||||
const runner = readFileSync(UPGRADE_SURVIVOR_DOCKER_E2E_PATH, "utf8");
|
||||
|
||||
const summaryDefaultIndex = runner.indexOf('startup_summary="n/a"');
|
||||
const autoAuthIndex = runner.indexOf(
|
||||
'if [ "$UPDATE_RESTART_MODE" = "auto-auth" ]; then',
|
||||
summaryDefaultIndex,
|
||||
);
|
||||
const manualSummaryIndex = runner.indexOf('startup_summary="${start_seconds}s"', autoAuthIndex);
|
||||
const successIndex = runner.indexOf(
|
||||
"startup=${startup_summary} status=${status_seconds}s",
|
||||
manualSummaryIndex,
|
||||
);
|
||||
|
||||
expect(summaryDefaultIndex).toBeGreaterThan(-1);
|
||||
expect(autoAuthIndex).toBeGreaterThan(summaryDefaultIndex);
|
||||
expect(manualSummaryIndex).toBeGreaterThan(autoAuthIndex);
|
||||
expect(successIndex).toBeGreaterThan(manualSummaryIndex);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["start budget", "OPENCLAW_UPGRADE_SURVIVOR_START_BUDGET_SECONDS", "90s"],
|
||||
["status budget", "OPENCLAW_UPGRADE_SURVIVOR_STATUS_BUDGET_SECONDS", "30s"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue