From 381aab0d838d451747825f6ffa2175c71121f9f5 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Mon, 23 Mar 2026 04:35:43 -0700 Subject: [PATCH] Add persistent virtual display for all UI regression tests The browser find focus test was failing because XCUIApplication.launch() cannot foreground-activate the app on headless CI runners (WarpBuild) without a display. The display resolution test already had its own virtual display, but it was scoped to that step only. Create a persistent virtual display at the start of the ui-regressions job that stays alive for all test steps. Also switch the browser test from `test` to `test-without-building` since the build step already ran. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f5112bc..77831836 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -488,6 +488,36 @@ jobs: -destination "platform=macOS" \ build-for-testing + - name: Create persistent virtual display + run: | + set -euo pipefail + HELPER_PATH="/tmp/create-virtual-display" + clang -framework Foundation -framework CoreGraphics \ + -o "$HELPER_PATH" scripts/create-virtual-display.m + + VDISPLAY_READY="/tmp/cmux-vdisplay-persistent.ready" + VDISPLAY_ID_PATH="/tmp/cmux-vdisplay-persistent.id" + rm -f "$VDISPLAY_READY" "$VDISPLAY_ID_PATH" + + "$HELPER_PATH" \ + --modes "1920x1080" \ + --ready-path "$VDISPLAY_READY" \ + --display-id-path "$VDISPLAY_ID_PATH" \ + > /tmp/cmux-vdisplay-persistent.log 2>&1 & + echo "VDISPLAY_PERSISTENT_PID=$!" >> "$GITHUB_ENV" + + echo "Waiting for persistent virtual display..." + for i in $(seq 1 24); do + if [ -f "$VDISPLAY_READY" ]; then break; fi + sleep 0.5 + done + if [ ! -f "$VDISPLAY_READY" ]; then + echo "ERROR: Persistent virtual display not ready after 12s" >&2 + cat /tmp/cmux-vdisplay-persistent.log 2>/dev/null || true + exit 1 + fi + echo "Persistent virtual display ready: ID=$(cat "$VDISPLAY_ID_PATH")" + - name: Run display resolution churn UI regression run: | set -euo pipefail @@ -661,4 +691,12 @@ jobs: -destination "platform=macOS" \ -maximum-test-execution-time-allowance 120 \ -only-testing:cmuxUITests/BrowserPaneNavigationKeybindUITests/testCmdFFocusesBrowserFindFieldAfterCmdDCmdLNavigation \ - test + test-without-building + + - name: Cleanup persistent virtual display + if: always() + run: | + if [ -n "${VDISPLAY_PERSISTENT_PID:-}" ]; then + kill "$VDISPLAY_PERSISTENT_PID" >/dev/null 2>&1 || true + fi + rm -f /tmp/cmux-vdisplay-persistent.ready /tmp/cmux-vdisplay-persistent.id /tmp/cmux-vdisplay-persistent.log