Open
Conversation
### Motivation: Enables re-use of EncodedEvent decoding logic for tools support interop. Today, corelibs XCTest manually re-defines the Resolves rdar://175287183 ### Modifications: * Implement decoding EncodedEvent -> Event * Test common decoding scenarios, included decoding issueRecorded and valueAttached event kinds
jerryjrchen
commented
Apr 22, 2026
| """) | ||
| let decoded = try #require(Event(decoding: event)) | ||
|
|
||
| guard case .issueRecorded(let issue) = decoded.kind else { |
Contributor
Author
There was a problem hiding this comment.
I wasn't sure if there was a nicer way of checking the enum case for kind since this enum has associated values
Contributor
There was a problem hiding this comment.
This is how we do it for the moment.
grynspan
reviewed
Apr 22, 2026
| // | ||
|
|
||
| @testable @_spi(ForToolsIntegrationOnly) import Testing | ||
| #if canImport(Foundation) |
Contributor
Author
There was a problem hiding this comment.
Yeah, realised I didn't need the import in my earlier change after writing the tests in this one. I can leave it out though
Contributor
There was a problem hiding this comment.
It's fine, just helps to explain this sort of thing in the PR. :)
This makes it easier to handle new event types and simplifies (?) the logic for managing currently support event kinds. No functional change in behaviour. This technically enables exit tests to handle .testSkipped event kinds, but this cannot occur in practise.
Comment on lines
+193
to
+194
| /// ``testID`` and ``testCaseID`` are always `nil` because we need information | ||
| /// from the associated `ABI.EncodedTest` to properly decode those values. |
Contributor
There was a problem hiding this comment.
So it'll just be follow-on work to fill in these missing property values, I take it?
stmontgomery
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Enables re-use of EncodedEvent decoding logic for tools support interop. Today, corelibs XCTest manually re-defines the
Resolves rdar://175287183
Modifications:
Implement decoding EncodedEvent -> Event
Test common decoding scenarios, included decoding issueRecorded and valueAttached event kinds
Checklist: