Skip to content

Conversation

stmontgomery
Copy link
Contributor

@stmontgomery stmontgomery commented Aug 26, 2025

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:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@stmontgomery stmontgomery added this to the Swift 6.x (main) milestone Aug 26, 2025
@stmontgomery stmontgomery self-assigned this Aug 26, 2025
@stmontgomery stmontgomery added the enhancement New feature or request label Aug 26, 2025
@stmontgomery stmontgomery added the tools integration 🛠️ Integration of swift-testing into tools/IDEs label Aug 26, 2025
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@grynspan grynspan left a 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.

@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery
Copy link
Contributor Author

@swift-ci please test

plemarquand added a commit to plemarquand/vscode-swift that referenced this pull request Aug 27, 2025
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.
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery force-pushed the experimental-abi-version branch from 5c325db to cbb9d89 Compare August 27, 2025 19:57
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

///
/// Otherwise, the value of this property is `false`.
static var includesExperimentalFields: Bool {
versionNumber < ABI.v6_3.versionNumber
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if version.versionNumber < ABI.v6_3.versionNumber || version.versionNumber >= ABI.ExperimentalVersion.versionNumber {
if version.includesExperimentalFields {

plemarquand added a commit to swiftlang/vscode-swift that referenced this pull request Sep 2, 2025
* 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.
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants