-
Notifications
You must be signed in to change notification settings - Fork 125
Refactor AdvancedConsoleOutputRecorder to use ABI.EncodedEvent architecture #1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…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>] = [:] |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
@swift-ci please test |
Sources/Testing/Events/Recorder/Event.AdvancedConsoleOutputRecorder.swift
Outdated
Show resolved
Hide resolved
0ba7497
to
ddf12ae
Compare
@swift-ci please test |
Key changes implemented:
ABI event processing: Added _processABIEvent() method with placeholder switch statement ready for failure summary implementation
Checklist: