-
Notifications
You must be signed in to change notification settings - Fork 120
Define an experimental event stream version and use it to conditionalize relevant content #1287
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
base: main
Are you sure you want to change the base?
Define an experimental event stream version and use it to conditionalize relevant content #1287
Conversation
…ize relevant content
@swift-ci please test |
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.
We should see what the VS Code plugin might be relying on before blocking stuff off.
@swift-ci please test |
@swift-ci please test |
swiftlang/swift-testing#1287 gates the `_testCase` field behind the experimental version number check, which will be tied to the swift version of the client, supplied by vs code. Set the `SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING` flag to allow any version of swift-testing to continue to work with the extension.
@swift-ci please test |
5c325db
to
cbb9d89
Compare
@swift-ci please test |
Sources/Testing/ABI/ABI.swift
Outdated
/// | ||
/// Otherwise, the value of this property is `false`. | ||
static var includesExperimentalFields: Bool { | ||
versionNumber < ABI.v6_3.versionNumber |
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.
This might be more readable as a range switch.
@@ -376,7 +376,7 @@ struct SwiftPMTests { | |||
} | |||
#expect(testRecords.count == 1) | |||
for testRecord in testRecords { | |||
if version.versionNumber >= ABI.v6_3.versionNumber { | |||
if version.versionNumber < ABI.v6_3.versionNumber || version.versionNumber >= ABI.ExperimentalVersion.versionNumber { |
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 version.versionNumber < ABI.v6_3.versionNumber || version.versionNumber >= ABI.ExperimentalVersion.versionNumber { | |
if version.includesExperimentalFields { |
* Set env var to preserve test case encoding w/ swift testing swiftlang/swift-testing#1287 gates the `_testCase` field behind the experimental version number check, which will be tied to the swift version of the client, supplied by vs code. Set the `SWT_ENABLE_EXPERIMENTAL_EVENT_STREAM_TEST_CASE_ENCODING` flag to allow any version of swift-testing to continue to work with the extension.
@swift-ci please test |
This PR formally defines an "experimental" event stream version (named
ABI.ExperimentalVersion
) which represents content that is considered experimental. It then adopts the new experimental version in several places to conditionalize the inclusion of fields on event stream models which are not yet officially included in any defined, supported version. Finally, it uses this new version everywhere that intentionally always uses the highest experimental version, such as the exit test back channel and the recently-added experimental console output recorder.Motivation:
The event stream now has an established versioning system (as of #956) and can easily conditionalize content based on version. As a general rule, we prefer to exclude content which has not gone through Swift Evolution review when delivering data to event stream consumers which expect to receive content from a supported version. The fields this PR conditionalizes have underscore prefixes and have code-level documentation indicating their unofficial-ness, but the fact that they are included at all in supported/non-experimental version streams could lead to misuse or unintentional breakages in the future if the names or semantics of these fields change.
Checklist: