Skip to content

Conversation

tienquocbui
Copy link
Member

@tienquocbui tienquocbui commented Aug 27, 2025

Implement hierarchical console output with comprehensive test result display

Modifications:

  • Implemented a tree structure using Unicode box-drawing characters (┌─, ├─, ╰─, │) that properly displays the relationship between modules, test suites, and individual tests with ASCII fallback
  • Test Result Summary:
    • Right-aligned duration formatting in consistent x.xxs format
    • Updated summary format: "X tests completed in Y.ZZs (pass: A, fail: B, skip: C)"
    • Concise failure summaries in hierarchy for quick scanning
  • Detailed Failure Section:
    • Complete hierarchical path display for failed tests
    • Comprehensive failure analysis with test count: "FAILED TEST DETAILS (3)"
    • Detailed expectation failure messages with actual vs expected values
    • Source location information with file and line numbers
    • Progress tracking with error counters [1/3], [2/3], [3/3]
    • Support for multiple expectations per test with individual analysis
  • Unit Tests: Added automated tests following established patterns to validate output formatting, hierarchy generation, and failure handling

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

tienquocbui and others added 30 commits July 7, 2025 21:30
…ting

- Implement Event.AdvancedConsoleOutputRecorder with beautiful tree structure
- Add SF symbols support with colors (play.circle, checkmark.circle, x.circle, etc.)
- Right-aligned timing display with 80-column fixed width
- Unicode box-drawing characters for hierarchical test output
- Issues displayed as sub-nodes under failed tests
- Enhanced start message with test count and running status
- Thread-safe parallel execution support
- Color-coded final summary with status icons
- Replace basic ConsoleOutputRecorder with enhanced version
- Add demo test files for validation

Features:
✅ Hierarchical tree structure with proper indentation
✅ SF Symbols on macOS with Unicode fallback
✅ Right-aligned timing information
✅ Color-coded status icons and output
✅ Issues as expandable sub-nodes
✅ Enhanced start/end messages
✅ Thread-safe concurrent test execution
Implementing progress bar with live update
- Add experimental AdvancedConsoleOutputRecorder activated via environment variable
- Implement clean skeleton structure for incremental PR development
- Fix terminal width hardcoding with 80-char safe fallback
- Follow HumanReadableOutputRecorder delegation pattern
- Update style guide compliance (80-char comment wrapping)
- Re-enable AttachmentTests and disable slow demo test suites
- Remove Foundation dependencies and signal handling
- Prepare foundation for PR #1 (Skeleton), PR #2 (Hierarchy), PR #3 (Progress)
- Update to latest main branch from upstream/main
- Integrate new ABI version handling and entry point improvements
- Preserve AdvancedConsoleOutputRecorder skeleton implementation
- Ready for first PR submission
Complete skeleton PR #1 preparation:
- Clean AdvancedConsoleOutputRecorder framework
- Environment variable activation integrated
- Latest upstream changes merged
- Ready for first PR submission
- Use upstream conditional compilation directives
- Match upstream verbosity check (> .min instead of >= 0)
- Simplify AdvancedConsoleOutputRecorder options for skeleton
- Fix event handler ordering to match upstream pattern
- Maintain zero impact on default behavior
The Environment.flag(named:) function returns Bool? but was being used directly in an if statement. Changed to explicit comparison with true to handle the optional properly.
- Change handle() to record() for consistency with other recorders
- Update documentation to use proper DocC reference (Event/ConsoleOutputRecorder)
- Remove unused configuration options (useHierarchicalOutput, showSuccessfulTests)
- Simplify LiveUpdatingLine documentation
- Remove future capability descriptions from main documentation
Since we cannot control the output stream, the LiveUpdatingLine functionality
is not usable in practice and should be removed from the skeleton implementation.
- Convert from Event to ABI.EncodedEvent for internal processing
- Add test storage dictionary keyed by test ID string
- Handle test discovery events to populate test storage
- Add ABI event processing placeholder for future enhancements
- Add missing SendableMetatype protocol definition

This refactor follows Stuart's guidance to prepare for future harness
process separation by using ABI data types throughout.
- Remove SendableMetatype protocol (not needed, provided by Swift stdlib)
- Use ABI.HighestVersion instead of CurrentVersion for forward compatibility
- Remove explicit verbosity parameter (uses default from eventContext.configuration)
- Fix DocC style for single parameter documentation
- Refactor storage into Context struct for extensibility
- Use _context.withLock instead of _testStorage for cleaner organization

Ready for public PR as requested.
…nsoleOutputRecorder setup)

- Resolved conflicts in Event.AdvancedConsoleOutputRecorder.swift (kept full hierarchical implementation)
- Remove ┌─ symbol for single module testing (flush left rendering)
- Preserve ┌─ symbol for multiple module testing (full tree structure)
- Add isSingleRoot parameter to _renderHierarchyNode
@stmontgomery
Copy link
Contributor

@swift-ci please test

@stmontgomery stmontgomery added the gsoc ☀️ Google Summer of Code contributions label Aug 27, 2025
@tienquocbui tienquocbui requested a review from grynspan August 28, 2025 09:13
@stmontgomery
Copy link
Contributor

@swift-ci please test

@stmontgomery stmontgomery merged commit e4e0b88 into swiftlang:main Sep 19, 2025
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-line experience ⌨️ enhancements to the command line interface enhancement New feature or request gsoc ☀️ Google Summer of Code contributions issue-handling Related to Issue handling within the testing library
Projects
Development

Successfully merging this pull request may close these issues.

3 participants