Decode EncodedEvent -> Event#1684
Merged
jerryjrchen merged 2 commits intoswiftlang:mainfrom Apr 23, 2026
Merged
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
grynspan
reviewed
Apr 22, 2026
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?
Contributor
There was a problem hiding this comment.
Test.Case.ID isn't stable yet, so we can't really decode it right now. Test.ID may need to be modified to allow it to take a flat string instead of a SourceLocation, but I think it's feasible.
Contributor
Author
There was a problem hiding this comment.
It's ok to have as nil for the time being because interop does not look at this field.
stmontgomery
approved these changes
Apr 23, 2026
grynspan
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 interop and exit tests
The decoding is lossy, i.e. you can't recover all the original Event
details. For example, testID is left as nil, which we may want to
address in the future.
The current decoding supports these use cases:
Corelibs XCTest manually re-defined the record type to decode events
from the fallback event handler.
Now, it can use this decoding init directly.
Exit tests only decoded a subset of event kinds.
Now, they still only process a limited set of event kinds. But, the
implementation is simplified and we can easily extend it to support
future event kinds if so desired.
Resolves rdar://175287183
Modifications:
Implement decoding EncodedEvent -> Event
Adopt for exit tests
Test common decoding scenarios, included decoding issueRecorded and valueAttached event kinds
Checklist: