fix(release): preserve upgrade diagnostic probe (#123338)

* fix(release): preserve upgrade diagnostic probe

* test(vitest): reinstantiate contract projects for audits

* style(test): format upgrade diagnostic assertions

* test(ui): isolate route transition outlet fixture
This commit is contained in:
Peter Steinberger
2026-08-13 16:56:43 -07:00
committed by GitHub
parent f66a2c6a29
commit 1287befae7
10 changed files with 114 additions and 46 deletions
+35
View File
@@ -185,6 +185,15 @@ function expectTextToIncludeAll(text: string, snippets: readonly string[]): void
}
}
function expectTextToIncludeInOrder(text: string, snippets: readonly string[]): void {
let offset = 0;
for (const snippet of snippets) {
const index = text.indexOf(snippet, offset);
expect(index).toBeGreaterThanOrEqual(offset);
offset = index + snippet.length;
}
}
function extractUpgradeSurvivorSupervisor(script: string): string {
const match = script.match(
/cat >"\$supervisor_script" <<'SUPERVISOR'\n(?<source>[\s\S]*?)\nSUPERVISOR/u,
@@ -3284,6 +3293,32 @@ if (starts === 1) {
const runner = readFileSync(UPGRADE_SURVIVOR_DOCKER_E2E_PATH, "utf8");
const publishedRunner = readFileSync(UPGRADE_SURVIVOR_RUN_SCRIPT, "utf8");
expectTextToIncludeInOrder(runner, [
"update_status=$?",
'if [ "$update_status" -ne 0 ]; then',
'echo "openclaw update failed" >&2',
"openclaw config validate --json >/tmp/openclaw-upgrade-survivor-post-update-validate.json",
'echo "post-update config validation probe status=$validate_status" >&2',
"openclaw_e2e_print_log /tmp/openclaw-upgrade-survivor-post-update-validate.err >&2 || true",
"openclaw_e2e_print_log /tmp/openclaw-upgrade-survivor-post-update-validate.json >&2 || true",
"openclaw_e2e_print_log /tmp/openclaw-upgrade-survivor-update.err >&2 || true",
"openclaw_e2e_print_log /tmp/openclaw-upgrade-survivor-update.json >&2 || true",
'exit "$update_status"',
]);
expectTextToIncludeInOrder(publishedRunner, [
"local update_status=0",
'openclaw "${update_args[@]}" >"$UPDATE_JSON" 2>"$UPDATE_ERR" || update_status=$?',
'if [ "$update_status" -ne 0 ]; then',
'echo "openclaw update failed" >&2',
'openclaw config validate --json >"$POST_UPDATE_VALIDATE_JSON"',
'echo "post-update config validation probe status=$validate_status" >&2',
'openclaw_e2e_print_log "$POST_UPDATE_VALIDATE_ERR" >&2 || true',
'openclaw_e2e_print_log "$POST_UPDATE_VALIDATE_JSON" >&2 || true',
'openclaw_e2e_print_log "$UPDATE_ERR" >&2 || true',
'openclaw_e2e_print_log "$UPDATE_JSON" >&2 || true',
'return "$update_status"',
]);
expectTextToIncludeAll(runner, [
"openclaw_e2e_print_log /tmp/openclaw-upgrade-survivor-update.err",
"openclaw_e2e_print_log /tmp/openclaw-upgrade-survivor-update.json",