Skip to content

feat(events): emit per-test timing in test results#339

Open
codeman9 wants to merge 7 commits intogetsentry:mainfrom
codeman9:feat/per-test-timing
Open

feat(events): emit per-test timing in test results#339
codeman9 wants to merge 7 commits intogetsentry:mainfrom
codeman9:feat/per-test-timing

Conversation

@codeman9
Copy link
Copy Markdown
Contributor

Emit a test-case-result pipeline event for every individual test case (passed, failed, skipped) with its duration. Previously only TestFailureEvent carried per-test timing; passing and skipped tests were reduced to aggregate counters in TestProgressEvent, discarding the duration that xcodebuild already provides.

The new TestCaseResultEvent is emitted from both xcodebuild-event-parser and swift-testing-event-parser, collected in XcodebuildRunState, and rendered as a per-test timing breakdown before the summary line. The event carries suite, test, status, and durationMs.

Per-test output is opt-in via the showTestResults session default or XCODEBUILDMCP_SHOW_TEST_RESULTS env var. When disabled (the default), only the aggregate summary line is shown.

Example output when enabled:

Test Results:
  ✅ Suite/testA (0.001s)
  ❌ Suite/testB (0.002s)
  ⏭️ Suite/testC

✅ 2 tests passed, 1 skipped (⏱️ 3.2s)

All 1446 tests pass (6 new). Verified against a real iOS project (201 tests).

Emit a test-case-result event for every individual test case (passed,
failed, skipped) with its duration. Previously only failures carried
per-test timing; passing tests were reduced to aggregate counters.
Track TestCaseResultEvent in XcodebuildRunState so downstream consumers
can access per-test timing data.
Render a Test Results section before the summary line showing each test
case with its status icon, suite/test name, and duration.
…tput

Per-test timing is opt-in via the showTestResults session default or
XCODEBUILDMCP_SHOW_TEST_RESULTS env var. When disabled (the default),
only the aggregate summary line is shown.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/xcodebuildmcp@339

commit: fdda57f

Comment thread src/rendering/render.ts
Comment thread src/utils/swift-testing-event-parser.ts
Fixes a bug where the interactive CLI text path did not read
showTestResults from the session store, so per-test results were
never shown even when the feature was enabled.
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a38d806. Configure here.

Comment thread src/utils/renderers/cli-text-renderer.ts
Avoid accumulating test-case-result events when showTestResults is
disabled, matching the existing suppressWarnings collection pattern.
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