Skip to content

Add the formalized Swift Testing event stream arguments to swift test. #7768

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

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

grynspan
Copy link
Contributor

This PR adds --configuration-path, --event-stream-output-path, and --event-stream-version to swift test.

For more information, see the Swift Testing API proposal here.

This PR adds `--configuration-path`, `--event-stream-output-path`, and
`--event-stream-version` to `swift test`.

For more information, see the Swift Testing API proposal [here](https://github.com/apple/swift-testing/blob/main/Documentation/Proposals/0002-json-abi.md).
@grynspan grynspan added swift test Changes impacting `swift test` tool command-line interface swift 6.0 Related to Swift 6.0 release branch labels Jul 10, 2024
@grynspan grynspan self-assigned this Jul 10, 2024
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

See also swiftlang/swift-testing#479

struct TestEventStreamOptions: ParsableArguments {
/// Legacy equivalent of ``configurationPath``.
@Option(name: .customLong("experimental-configuration-path"),
help: .private)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's private vs hidden? Haven't seen private before 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hidden means it still shows up in verbose help. Private means it is never shown in help.

@@ -656,6 +677,10 @@ extension SwiftTestCommand {
@OptionGroup()
var testLibraryOptions: TestLibraryOptions

/// Options for Swift Testing's event stream.
@OptionGroup()
var testEventStreamOptions: TestEventStreamOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really for just configuration rather than the stream options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand, sorry?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is in list. Does list actually need all these, or does it just need the configuration path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

list can use them all now! See swiftlang/swift-testing#511

@grynspan grynspan merged commit 125b3eb into main Jul 12, 2024
5 checks passed
@grynspan grynspan deleted the jgrynspan/formalized-swift-testing-event-stream-args branch July 12, 2024 00:20
grynspan added a commit to swiftlang/swift-testing that referenced this pull request Jul 12, 2024
This PR changes the behavior of `swift test list` and its various
synonyms to allow reporting the list of tests via the ABI-stable JSON
mechanism described in #479.

As it is not currently possible to directly call `swift test list
--event-stream-output-path ... --event-stream-version 0`, it's a bit
hard to test this code. However, it is possible to opt into this mode
using `--configuration-path` and passing a path to a JSON file that
includes `"listTests": true` (as noted by @allevato.) Support for these
arguments with `swift test list` is tracked by
swiftlang/swift-package-manager#7768.

Resolves #506.
Resolves rdar://130627856.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-line interface swift test Changes impacting `swift test` tool swift 6.0 Related to Swift 6.0 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants