Files
opencode-manager/e2e/server.sh
Chris Scott 0b42f7de97 test(e2e): clean up run artifacts after the suite
- server.sh removes e2e/.tmp when the backend exits, forwarding SIGTERM so
  Playwright's graceful shutdown still applies
- a cleanup reporter removes playwright-report and test-results after a
  passing run; failed runs keep them for debugging and CI upload
2026-10-12 09:31:13 -04:00

16 lines
393 B
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
TMP="$ROOT/e2e/.tmp"
rm -rf "$TMP"
mkdir -p "$TMP/home" "$TMP/data" "$TMP/workspace" "$TMP/tmp" "$TMP/run"
trap 'rm -rf "$TMP"' EXIT
cd "$ROOT"
bun run backend/dist/index.js &
BACKEND_PID=$!
trap 'kill -TERM "$BACKEND_PID" 2>/dev/null || true' TERM INT
wait "$BACKEND_PID" || wait "$BACKEND_PID"