test: stop macOS VM after Discord smoke

This commit is contained in:
Peter Steinberger
2026-04-23 15:29:25 +01:00
parent b2bbe61571
commit 8435cb80ac
3 changed files with 26 additions and 0 deletions

View File

@@ -144,6 +144,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo
- `--discord-token-env`
- `--discord-guild-id`
- `--discord-channel-id`
- After a successful Discord smoke/roundtrip, shut down the guest VM before handoff (`prlctl stop "$VM_NAME"` or the concrete VM name). The macOS smoke harness should do this automatically after successful Discord proof; still stop the VM manually after ad-hoc Discord checks. Do not leave the Discord-configured guest running; it can keep reading/posting in `#maintainer` and spam Discord after the proof is complete.
- Keep the Discord token only in a host env var.
- Use installed `openclaw message send/read`, not `node openclaw.mjs message ...`.
- Set `channels.discord.guilds` as one JSON object, not dotted config paths with snowflakes.

View File

@@ -50,6 +50,7 @@ pnpm test:parallels:macos \
- Avoid `prlctl enter` / expect for long Discord setup scripts; it line-wraps/corrupts long commands. Use `prlctl exec --current-user /bin/sh -lc ...` for the Discord config phase.
- Full 3-OS sweeps: the shared build lock is safe in parallel, but snapshot restore is still a Parallels bottleneck. Prefer serialized Windows/Linux restore-heavy reruns if the host is already under load.
- Harness cleanup deletes the temporary Discord smoke messages at exit.
- After a successful Discord roundtrip, shut down the macOS guest before handoff (`prlctl stop "macOS Tahoe"`). The macOS smoke harness should do this automatically after successful Discord proof; still stop the VM manually after ad-hoc Discord checks. Do not leave the Discord-configured VM running; it can keep reading/posting in `#maintainer` and spam Discord after the proof is complete.
- Per-phase logs: `/tmp/openclaw-parallels-smoke.*`
- Machine summary: pass `--json`
- If roundtrip flakes, inspect `fresh.discord-roundtrip.log` and `discord-last-readback.json` in the run dir first.

View File

@@ -293,6 +293,28 @@ discord_smoke_enabled() {
[[ -n "$DISCORD_TOKEN_VALUE" && -n "$DISCORD_GUILD_ID" && -n "$DISCORD_CHANNEL_ID" ]]
}
successful_discord_smoke() {
discord_smoke_enabled || return 1
[[ "$FRESH_DISCORD_STATUS" == "pass" || "$UPGRADE_DISCORD_STATUS" == "pass" ]]
}
stop_vm_after_successful_discord_smoke() {
successful_discord_smoke || return 0
say "Stop $VM_NAME after successful Discord smoke"
set +e
if command -v gtimeout >/dev/null 2>&1; then
gtimeout --foreground 120s prlctl stop "$VM_NAME"
else
prlctl stop "$VM_NAME"
fi
local rc=$?
set -e
if (( rc != 0 )); then
warn "failed to stop $VM_NAME after successful Discord smoke (rc=$rc)"
fi
}
fresh_uses_host_tgz() {
if [[ -z "$TARGET_PACKAGE_SPEC" ]]; then
return 0
@@ -2018,6 +2040,8 @@ if [[ "$KEEP_SERVER" -eq 0 && -n "${SERVER_PID:-}" ]]; then
SERVER_PID=""
fi
stop_vm_after_successful_discord_smoke
SUMMARY_JSON_PATH="$(
SUMMARY_VM="$VM_NAME" \
SUMMARY_PROVIDER="$PROVIDER" \