Skip to content

Conversation

tienquocbui
Copy link
Member

Key changes implemented:

  • Event → ABI.EncodedEvent conversion: Using ABI.EncodedEvent<ABI.HighestVersion>(encoding: event, in: eventContext, messages: messages) for forward compatibility
  • Extensible context storage system: Added Locked struct containing test storage dictionary, designed for easy addition of result data and other event information in future PRs
  • Test discovery handling: Populates context storage during testDiscovered events for later lookup by test ID string
    ABI event processing: Added _processABIEvent() method with placeholder switch statement ready for failure summary implementation
  • Still delegates to fallback recorder to maintain existing functionality while demonstrating ABI conversion flow
  • Uses Event.HumanReadableOutputRecorder to generate messages that are passed to ABI encoding

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 21 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.
private struct Context: Sendable {
/// Storage for test information, keyed by test ID string value.
/// This is needed because ABI.EncodedEvent doesn't contain full test context.
var testStorage: [String: ABI.EncodedTest<ABI.HighestVersion>] = [:]
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to go the extra mile (likely necessary long-term) can we make this all generic over some V: ABI.Version?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the architectural guidance! I've implemented the generic version approach.

@tienquocbui tienquocbui requested a review from grynspan August 21, 2025 16:27
@stmontgomery stmontgomery added the enhancement New feature or request label Aug 21, 2025
@stmontgomery stmontgomery added command-line experience ⌨️ enhancements to the command line interface gsoc ☀️ Google Summer of Code contributions labels Aug 21, 2025
@stmontgomery stmontgomery added this to the Swift 6.x (main) milestone Aug 21, 2025
@stmontgomery
Copy link
Contributor

@swift-ci please test

@stmontgomery
Copy link
Contributor

@swift-ci please test

@stmontgomery stmontgomery merged commit 887871b into swiftlang:main Aug 22, 2025
3 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

Projects

Development

Successfully merging this pull request may close these issues.

3 participants