Accept arbitrary strings in Swift Testing event stream version options #8944
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.
This modifies the
swift test
command line@Option
properties which represent a Swift Testing event stream version (primarily--event-stream-version <...>
) to accept arbitraryString
arguments.Motivation:
In Swift Testing we are moving towards making the entry point and event stream versions aligned with the Swift version, rather than having an independent versioning scheme which users must look up or keep track of. Once this and other work lands, this means that in order to use the event stream format included in (for example) Swift 6.2, a user would pass
--event-stream-version 6.2
.However, until now these CLI options have required an integer argument like
--event-stream-version 0
. This change relaxes this requirement so that any arbitrary string will be accepted. In a separate PR, the Swift Testing library will perform additional validation of the format of this string to ensure it's valid, but we will need to continue accepting the current integers (e.g.0
) in addition to newer Swift versions (e.g.6.2
,6.3
, …) going forward.Modifications:
Int?
type of these options withString?
.Result:
In local testing, I'm able to pass any string argument now.