From 77a59b57439e18d0ab894a7c358e703ed33d5047 Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:19:04 -0800 Subject: [PATCH] Fix UI test hang: set CMUX_TAG for debug launch guard Debug builds refuse to launch without CMUX_TAG to prevent accidental untagged launches. XCUITest launches the app as a separate process without XCTest env vars, so the app's isRunningUnderXCTest() check fails and the app calls exit(64). The test runner then waits forever for the app to report back. Set CMUX_TAG=ci in the CI env. --- .github/workflows/ci.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edf9b6f9..de3289bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,25 +90,12 @@ jobs: # Remove stale build cache to avoid incremental build errors rm -rf ~/Library/Developer/Xcode/DerivedData/GhosttyTabs-* - - name: Build for testing - run: | - set -euo pipefail - xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination "platform=macOS" build-for-testing - - - name: Allow ad-hoc signed app to launch - run: | - # The runner has no development certificates, so the app is ad-hoc signed. - # Gatekeeper blocks ad-hoc apps, causing XCUITest to hang on launch. - # Remove the signature so macOS treats it as unsigned (launchable) instead. - APP_PATH="$(find ~/Library/Developer/Xcode/DerivedData/GhosttyTabs-*/Build/Products/Debug -name 'cmux DEV.app' -print -quit)" - if [ -z "$APP_PATH" ]; then - echo "Built app not found in DerivedData" >&2 - exit 1 - fi - codesign --remove-signature "$APP_PATH" - echo "Removed ad-hoc signature from: $APP_PATH" - - name: Run UI tests + env: + # Debug builds require CMUX_TAG to prevent accidental untagged launches. + # XCUITest launches the app as a separate process without XCTest env vars, + # so the app's isRunningUnderXCTest() check fails. Provide a tag explicitly. + CMUX_TAG: ci run: | set -euo pipefail - xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination "platform=macOS" -only-testing:cmuxUITests/UpdatePillUITests test-without-building + xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination "platform=macOS" -only-testing:cmuxUITests/UpdatePillUITests test