Skip to content

Auto-surface errors and failed tests on build failure#29

Merged
conorluddy merged 1 commit intomainfrom
feat/auto-surface-build-errors
Feb 24, 2026
Merged

Auto-surface errors and failed tests on build failure#29
conorluddy merged 1 commit intomainfrom
feat/auto-surface-build-errors

Conversation

@conorluddy
Copy link
Owner

Summary

  • On build/test failure, the top 5 errors and/or failed test details are now shown inline in the default minimal output
  • Previously, agents saw only Build: FAILED (1 errors, 0 warnings) and needed a second round-trip with --get-errors to see actual error messages
  • Success output is unchanged (zero token increase for passing builds)
  • --verbose output unchanged
  • --get-errors <id> still works for deeper drill-down
  • JSON output on failure now includes errors and failed_tests arrays

Example output after this change

Build failure:

Build: FAILED (2 errors, 0 warnings) [xcresult-20260224-221804]

Errors (2):

1. Cannot find 'MyProtocol' in scope
   Location: /path/to/File.swift:line 135

2. Type 'ViewController' does not conform to 'Sendable'
   Location: /path/to/VC.swift:line 42

Test failure:

Tests: FAIL (11/12 passed, 4.2s) [xcresult-20260224-221804]

Failed tests (1):

1. LoginFlowTests/testInvalidCredentials
   XCTAssertEqual failed: ("Error") is not equal to ("Success")

Test plan

  • Linting passes on all modified files
  • --help still works
  • Introduce deliberate build error in a test project, confirm errors appear inline
  • Introduce deliberate test failure, confirm failed test details appear
  • --json on failure includes errors array; on success, no errors key
  • --verbose output unchanged

🤖 Generated with Claude Code

Previously, build_and_test.py showed only "Build: FAILED (1 errors, 0
warnings)" on failure, forcing agents into a second round-trip with
--get-errors to see what went wrong.

Now on failure, the top 5 errors and/or failed test details are shown
inline in the default minimal output. Success output is unchanged
(zero token increase for passing builds).

Changes:
- Add get_failed_tests() to XCResultParser (defensive, returns [] on
  parse failure)
- Add format_test_failures() to OutputFormatter
- Extend format_minimal() with errors/failed_tests params
- Restructure build_and_test.py to collect and pass through errors,
  test info, and failed tests to all output modes
- Include errors[:10] and failed_tests[:10] in JSON output on failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@conorluddy conorluddy merged commit df27f3d into main Feb 24, 2026
1 check passed
@conorluddy conorluddy deleted the feat/auto-surface-build-errors branch February 24, 2026 22:51
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