Skip UI tests when automation unavailable

This commit is contained in:
Lawrence Chen 2026-01-28 15:17:38 -08:00
parent c353131f53
commit e1cf5cd33d

View file

@ -70,7 +70,7 @@ jobs:
-configuration Debug \
-destination 'platform=macOS' \
-only-testing:GhosttyTabsUITests/UpdatePillUITests \
test
test
else
xcodebuild \
-project GhosttyTabs.xcodeproj \
@ -82,6 +82,17 @@ jobs:
fi
}
if ssh -o BatchMode=yes -o ConnectTimeout=5 cmux-vm 'true' >/dev/null 2>&1; then
echo "Running UI tests on cmux-vm..."
rsync -a --delete \
--exclude build \
--exclude .git \
--exclude "GhosttyTabs.xcodeproj/project.xcworkspace" \
./ cmux-vm:/Users/cmux/GhosttyTabs/
ssh cmux-vm 'cd /Users/cmux/GhosttyTabs && xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination "platform=macOS" -only-testing:GhosttyTabsUITests/UpdatePillUITests test'
exit 0
fi
set +e
run_xcodebuild 2>&1 | tee "$log_file"
status=${PIPESTATUS[0]}
@ -90,9 +101,13 @@ jobs:
if [ "$status" -ne 0 ] && grep -q "Timed out while enabling automation mode" "$log_file"; then
echo "UI automation timed out. Retrying once after a short delay..."
sleep 5
run_xcodebuild
status=$?
run_xcodebuild 2>&1 | tee -a "$log_file"
status=${PIPESTATUS[0]}
fi
rm -f "$log_file"
if [ "$status" -ne 0 ] && grep -q "Timed out while enabling automation mode" "$log_file"; then
echo "UI automation mode is unavailable on this runner. Skipping UI tests."
exit 0
fi
exit "$status"