Skip to content

Improve Depot test workflow: diagnostics, filter, timeout - #720

Merged
lawrencecchen merged 1 commit into
mainfrom
task-xcuitests-depot
Mar 1, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
task-xcuitests-depot

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Mar 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add display diagnostics step (system_profiler, boot mode, accessibility) to debug why XCUITests fail/hang on Depot
  • Add test_filter input to run a specific test class (e.g. UpdatePillUITests) instead of the entire suite
  • Add test_timeout input (default 120s) with -maximum-test-execution-time-allowance to prevent individual tests from hanging forever (SidebarResizeUITests hung for 35+ minutes last run)

Testing

  • Merge to main, then trigger via gh workflow run test-depot.yml -f skip_unit_tests=true -f test_filter=UpdatePillUITests

Related

Summary by CodeRabbit

Release Notes

  • Chores
    • Enhanced CI/CD workflows with flexible test execution options including filtering and skip capabilities
    • Added configurable timeout settings for automated test runs
    • Introduced system diagnostics information gathering in CI pipeline
    • Expanded automated test coverage scope in continuous integration

@vercel

vercel Bot commented Mar 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Mar 1, 2026 0:05am

@coderabbitai

coderabbitai Bot commented Mar 1, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR modifies CI/CD workflows to expand test coverage in the main CI pipeline and introduces parameterized test control in the test-depot workflow, including optional unit test skipping, test filtering, and execution time allowance settings.

Changes

Cohort / File(s) Summary
Main CI Workflow
.github/workflows/ci.yml
Broadened UI test scope from a specific test (UpdatePillUITests) to all tests in the cmuxUITests suite.
Test Depot Workflow
.github/workflows/test-depot.yml
Added workflow inputs for skip_unit_tests, test_filter, and test_timeout. Made unit test execution conditional based on skip flag. Introduced Diagnostics step. Implemented dynamic test filtering via TEST_FILTER and execution time control via TEST_TIMEOUT environment variables, with conditional ONLY_TESTING flag computation for xcodebuild.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • PR #710: Directly modifies test-depot.yml with conditional UI test skipping and test selection, overlapping with this PR's new test filtering and control mechanisms.
  • PR #447: Updates CI xcodebuild UI test invocation for test scope and selection changes, similar to this PR's modifications to test targeting.

Poem

🐰 Workflows now dance with filters bright,
Unit tests skip when not in sight,
Timeouts tick with measured care,
Test-depot flows with grace to spare!
CI runs wide, tests spread with glee,
Flexible testing, wild and free! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely summarizes the main changes: adding diagnostics, filter, and timeout controls to the Depot test workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch task-xcuitests-depot

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f3885c1a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/usr/sbin/system_profiler SPSoftwareDataType | grep -i "boot mode" || true
echo ""
echo "=== Accessibility permissions ==="
tccutil reset Accessibility 2>/dev/null || true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove accessibility reset from diagnostics step

In test-depot.yml, the diagnostics block calls tccutil reset Accessibility, which mutates runner state instead of just collecting diagnostics; on Depot hosts that rely on pre-granted Accessibility access for UI automation, this revokes permission immediately before the Run UI tests step and can cause event-synthesis failures or hangs. Because this runs unconditionally for every dispatch, it can introduce flaky or consistently failing UI test runs.

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR enhances the Depot test workflow with three key improvements: diagnostic logging, test filtering, and timeout controls.

Key Changes:

  • Added skip_unit_tests input for more flexible test execution options
  • Added test_filter input to run specific UI test classes (e.g., UpdatePillUITests) instead of the entire suite
  • Added test_timeout input (default 120s) with -maximum-test-execution-time-allowance flag to prevent tests from hanging indefinitely
  • Added diagnostic step that logs screen resolution, boot mode, and accessibility permissions to help debug UI test failures on Depot
  • Updated ci.yml to run the full cmuxUITests suite instead of just UpdatePillUITests

The implementation uses bash conditionals to build the -only-testing argument dynamically based on the test_filter input, and applies the timeout to all UI tests. The diagnostic logging will help identify environment issues that cause XCUITests to fail or hang on headless Depot runners.

Confidence Score: 4/5

  • Safe to merge with minimal risk - adds useful debugging and control features to test workflow
  • The changes are well-structured and address real issues (hanging tests, debugging difficulties). Shell scripts follow proper practices with set -euo pipefail, error handling is appropriate, and the new inputs are optional with sensible defaults. Score reflects solid implementation with no critical issues.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/ci.yml Changed from running only UpdatePillUITests to running all cmuxUITests, aligning with the goal of running the full XCUITest suite
.github/workflows/test-depot.yml Added skip_unit_tests, test_filter, and test_timeout inputs; added diagnostics step for debugging; implemented conditional test filtering and per-test timeout

Last reviewed commit: 6f3885c

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

166-174: ⚠️ Potential issue | 🟠 Major

Add -maximum-test-execution-time-allowance to prevent hung UI tests from blocking the self-hosted runner.

Line 174 is missing the per-test timeout that the test-depot.yml workflow includes by default (120 seconds). Without it, a single hung UI test can block the self-hosted queue indefinitely. The test-depot.yml version explicitly sets this flag; ci.yml should match.

Suggested patch
       - name: Run UI tests
         run: |
           set -euo pipefail
           SOURCE_PACKAGES_DIR="$PWD/.ci-source-packages"
           xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug \
             -clonedSourcePackagesDirPath "$SOURCE_PACKAGES_DIR" \
             -disableAutomaticPackageResolution \
             -destination "platform=macOS" \
+            -maximum-test-execution-time-allowance 120 \
             -only-testing:cmuxUITests test
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 166 - 174, The xcodebuild invocation
in the "Run UI tests" step (the xcodebuild call that specifies -project
GhosttyTabs.xcodeproj, -scheme cmux and -only-testing:cmuxUITests) is missing
the per-test timeout flag; add the -maximum-test-execution-time-allowance 120
(or your desired seconds) to the xcodebuild arguments so a hung UI test won't
block the self-hosted runner, ensuring the flag is added alongside the existing
options in that Run UI tests step.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/test-depot.yml:
- Around line 85-95: The "Display diagnostics" workflow step mutates runner
state by calling tccutil reset Accessibility; remove the mutation to keep
diagnostics read-only by deleting or commenting out the tccutil reset
Accessibility (and the "Accessibility reset attempted" echo) in the "Display
diagnostics" step so only non-mutating commands like system_profiler and greps
remain, ensuring XCUITest accessibility permissions are preserved for the
subsequent "Run UI tests" step.
- Around line 173-184: The xcodebuild command currently expands $ONLY_TESTING
unquoted which allows user-supplied TEST_FILTER to cause word-splitting or
injection; update the xcodebuild invocation to quote the variable (use
"$ONLY_TESTING") so the entire value is passed as a single argument, keeping the
existing logic that sets ONLY_TESTING from TEST_FILTER intact and preventing
malformed CLI args when TEST_FILTER contains spaces or metacharacters.
- Around line 24-27: Validate the workflow input `test_timeout` before it's
passed to xcodebuild: in the "Run UI tests" step add a check that `test_timeout`
is a positive integer (or empty) and if it isn't, fail the step with a clear
error message explaining that `test_timeout` must be a numeric value in seconds;
only pass `-maximum-test-execution-time-allowance` to xcodebuild when validation
succeeds and include the validated numeric value, otherwise omit the flag to
avoid xcodebuild cryptic failures.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 166-174: The xcodebuild invocation in the "Run UI tests" step (the
xcodebuild call that specifies -project GhosttyTabs.xcodeproj, -scheme cmux and
-only-testing:cmuxUITests) is missing the per-test timeout flag; add the
-maximum-test-execution-time-allowance 120 (or your desired seconds) to the
xcodebuild arguments so a hung UI test won't block the self-hosted runner,
ensuring the flag is added alongside the existing options in that Run UI tests
step.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc1b6fd and 6f3885c.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/test-depot.yml

Comment on lines +24 to +27
test_timeout:
description: "Per-test timeout in seconds (default: 120)"
required: false
default: "120"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Read the relevant sections of the test-depot.yml file
head -n 35 .github/workflows/test-depot.yml

Repository: manaflow-ai/cmux

Length of output: 977


🏁 Script executed:

# Check how TEST_TIMEOUT is used around line 24-27 and later invocations
cat -n .github/workflows/test-depot.yml | sed -n '20,40p'

Repository: manaflow-ai/cmux

Length of output: 802


🏁 Script executed:

# Look at lines around 167 and 183 to see if similar issues exist there
cat -n .github/workflows/test-depot.yml | sed -n '160,190p'

Repository: manaflow-ai/cmux

Length of output: 1135


🏁 Script executed:

# Find all references to test_timeout and TEST_TIMEOUT in the workflow
rg -n 'test_timeout|TEST_TIMEOUT' .github/workflows/test-depot.yml

Repository: manaflow-ai/cmux

Length of output: 219


🏁 Script executed:

# Get the full workflow file to identify all test invocations
wc -l .github/workflows/test-depot.yml

Repository: manaflow-ai/cmux

Length of output: 96


🏁 Script executed:

# Check if there are other test sections beyond what we've seen
cat -n .github/workflows/test-depot.yml | tail -100

Repository: manaflow-ai/cmux

Length of output: 4688


🏁 Script executed:

# Check xcodebuild documentation or search for any error handling patterns
# Let's also verify if there's any validation elsewhere in the codebase
rg -n 'maximum-test-execution-time-allowance|test.timeout|TEST_TIMEOUT' . --type yaml --type sh --type bash | head -20

Repository: manaflow-ai/cmux

Length of output: 88


🏁 Script executed:

# Search for any xcodebuild error handling or validation patterns
rg -n '\[0-9\]|^[0-9]|=~.*[0-9]' .github/workflows/ --type yaml | grep -i timeout

Repository: manaflow-ai/cmux

Length of output: 42


🏁 Script executed:

# Get full context around the UI tests section to understand the error handling
cat -n .github/workflows/test-depot.yml | sed -n '163,185p'

Repository: manaflow-ai/cmux

Length of output: 1085


Add validation for test_timeout before passing to xcodebuild.

test_timeout is a free-form string input with no validation. Non-numeric values pass directly to the -maximum-test-execution-time-allowance xcodebuild flag, causing xcodebuild to fail with a cryptic error message. Validate early in the "Run UI tests" step to fail clearly with an actionable message.

Suggested patch
      - name: Run UI tests
        if: ${{ !inputs.skip_ui_tests }}
        env:
          TEST_FILTER: ${{ inputs.test_filter }}
          TEST_TIMEOUT: ${{ inputs.test_timeout || '120' }}
        run: |
          set -euo pipefail
          SOURCE_PACKAGES_DIR="$PWD/.ci-source-packages"

+         if ! [[ "$TEST_TIMEOUT" =~ ^[0-9]+$ ]] || [ "$TEST_TIMEOUT" -le 0 ]; then
+           echo "Invalid test_timeout: '$TEST_TIMEOUT'. Provide a positive integer (seconds)." >&2
+           exit 1
+         fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test-depot.yml around lines 24 - 27, Validate the workflow
input `test_timeout` before it's passed to xcodebuild: in the "Run UI tests"
step add a check that `test_timeout` is a positive integer (or empty) and if it
isn't, fail the step with a clear error message explaining that `test_timeout`
must be a numeric value in seconds; only pass
`-maximum-test-execution-time-allowance` to xcodebuild when validation succeeds
and include the validated numeric value, otherwise omit the flag to avoid
xcodebuild cryptic failures.

Comment on lines +85 to +95
- name: Display diagnostics
run: |
echo "=== Screen resolution ==="
system_profiler SPDisplaysDataType 2>/dev/null || echo "No display info available"
echo ""
echo "=== Window server ==="
/usr/sbin/system_profiler SPSoftwareDataType | grep -i "boot mode" || true
echo ""
echo "=== Accessibility permissions ==="
tccutil reset Accessibility 2>/dev/null || true
echo "Accessibility reset attempted"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/test-depot.yml | head -100 | tail -20

Repository: manaflow-ai/cmux

Length of output: 951


🏁 Script executed:

# Get the exact section around lines 85-95
sed -n '75,100p' .github/workflows/test-depot.yml

Repository: manaflow-ai/cmux

Length of output: 1059


🏁 Script executed:

# Check if there are other steps in the same job that might use UI automation
rg -n "ui|UI|accessibility|Accessibility|automation|screenshot|xcode" .github/workflows/test-depot.yml -i

Repository: manaflow-ai/cmux

Length of output: 1927


Keep diagnostics read-only; remove Accessibility reset.

The Display diagnostics step runs tccutil reset Accessibility (line 94), which mutates runner state by clearing accessibility permissions in the TCC database. The subsequent Run UI tests step requires those permissions for XCUITest framework to interact with UI elements. Resetting accessibility before UI tests invalidates the permissions needed for test automation.

Suggested patch
       - name: Display diagnostics
         run: |
           echo "=== Screen resolution ==="
           system_profiler SPDisplaysDataType 2>/dev/null || echo "No display info available"
           echo ""
           echo "=== Window server ==="
           /usr/sbin/system_profiler SPSoftwareDataType | grep -i "boot mode" || true
           echo ""
-          echo "=== Accessibility permissions ==="
-          tccutil reset Accessibility 2>/dev/null || true
-          echo "Accessibility reset attempted"
+          echo "=== Accessibility diagnostics ==="
+          echo "Skipping TCC reset in diagnostics step to avoid mutating test environment"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Display diagnostics
run: |
echo "=== Screen resolution ==="
system_profiler SPDisplaysDataType 2>/dev/null || echo "No display info available"
echo ""
echo "=== Window server ==="
/usr/sbin/system_profiler SPSoftwareDataType | grep -i "boot mode" || true
echo ""
echo "=== Accessibility permissions ==="
tccutil reset Accessibility 2>/dev/null || true
echo "Accessibility reset attempted"
- name: Display diagnostics
run: |
echo "=== Screen resolution ==="
system_profiler SPDisplaysDataType 2>/dev/null || echo "No display info available"
echo ""
echo "=== Window server ==="
/usr/sbin/system_profiler SPSoftwareDataType | grep -i "boot mode" || true
echo ""
echo "=== Accessibility diagnostics ==="
echo "Skipping TCC reset in diagnostics step to avoid mutating test environment"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test-depot.yml around lines 85 - 95, The "Display
diagnostics" workflow step mutates runner state by calling tccutil reset
Accessibility; remove the mutation to keep diagnostics read-only by deleting or
commenting out the tccutil reset Accessibility (and the "Accessibility reset
attempted" echo) in the "Display diagnostics" step so only non-mutating commands
like system_profiler and greps remain, ensuring XCUITest accessibility
permissions are preserved for the subsequent "Run UI tests" step.

Comment on lines +173 to +184
if [ -n "$TEST_FILTER" ]; then
ONLY_TESTING="-only-testing:cmuxUITests/$TEST_FILTER"
else
ONLY_TESTING="-only-testing:cmuxUITests"
fi

xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug \
-clonedSourcePackagesDirPath "$SOURCE_PACKAGES_DIR" \
-disableAutomaticPackageResolution \
-destination "platform=macOS" \
-only-testing:cmuxUITests/UpdatePillUITests test
-maximum-test-execution-time-allowance "$TEST_TIMEOUT" \
$ONLY_TESTING test

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/test-depot.yml | sed -n '170,190p'

Repository: manaflow-ai/cmux

Length of output: 803


🏁 Script executed:

rg -n 'TEST_FILTER' .github/workflows/test-depot.yml

Repository: manaflow-ai/cmux

Length of output: 227


🏁 Script executed:

head -100 .github/workflows/test-depot.yml | rg -n 'inputs|test_filter|on:'

Repository: manaflow-ai/cmux

Length of output: 528


🏁 Script executed:

head -30 .github/workflows/test-depot.yml

Repository: manaflow-ai/cmux

Length of output: 820


Quote ONLY_TESTING when passing it to xcodebuild.

The test_filter input on line 20 accepts arbitrary user-provided text with no validation. Line 184 expands $ONLY_TESTING unquoted, which contains this user input via line 174. If test_filter contains spaces or shell metacharacters, unquoted expansion will cause word splitting and produce malformed CLI arguments.

Suggested patch
          xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug \
            -clonedSourcePackagesDirPath "$SOURCE_PACKAGES_DIR" \
            -disableAutomaticPackageResolution \
            -destination "platform=macOS" \
            -maximum-test-execution-time-allowance "$TEST_TIMEOUT" \
-            $ONLY_TESTING test
+            "$ONLY_TESTING" test
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test-depot.yml around lines 173 - 184, The xcodebuild
command currently expands $ONLY_TESTING unquoted which allows user-supplied
TEST_FILTER to cause word-splitting or injection; update the xcodebuild
invocation to quote the variable (use "$ONLY_TESTING") so the entire value is
passed as a single argument, keeping the existing logic that sets ONLY_TESTING
from TEST_FILTER intact and preventing malformed CLI args when TEST_FILTER
contains spaces or metacharacters.

…orkflow

- Display diagnostics step to debug headless display issues
- test_filter input to run specific XCUITest classes
- test_timeout input (default 120s) to prevent test hangs
@lawrencecchen
lawrencecchen force-pushed the task-xcuitests-depot branch from 6f3885c to 6ca8972 Compare March 1, 2026 12:04
@lawrencecchen
lawrencecchen merged commit 1b160dc into main Mar 1, 2026
1 check was pending
bn-l pushed a commit to bn-l/cmux that referenced this pull request Apr 3, 2026
…orkflow (manaflow-ai#720)

- Display diagnostics step to debug headless display issues
- test_filter input to run specific XCUITest classes
- test_timeout input (default 120s) to prevent test hangs

This branch was successfully deployed

1 active deployment
Preview — 6ca89721 Deployed Mar 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant