-
Notifications
You must be signed in to change notification settings - Fork 127
Add an _ersatz_ filtering mechanism to XCTestScaffold.
#77
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
Conversation
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
grynspan
commented
Oct 23, 2023
Contributor
Author
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.
Just some editorial cleanup here.
Contributor
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.
thanks!
1459089 to
073c5df
Compare
suzannaratcliff
approved these changes
Oct 23, 2023
Contributor
Author
|
@swift-ci please test |
Because SwiftPM is not (yet) aware of swift-testing, `swift test --filter` does not have any effect on swift-testing tests. This PR adds temporary support for an environment variable, `"SWT_SELECTED_TEST_IDS"`, to stand in for `--filter` until such time as SwiftPM can be modified to support swift-testing. Note that the supported value of this environment variable is (intentionally) constrained to just test IDs right now. Matching display names or other metadata about tests is certainly possible, but it's beyond the scope of today's PR.
073c5df to
1e4dbd2
Compare
Contributor
Author
|
@swift-ci please test |
grynspan
added a commit
that referenced
this pull request
Oct 24, 2023
This PR is a follow-on to #77. It adds the ability to filter tests to just the ones that contain a given tag using an environment variable. As before, `swift test --filter` is unaware of swift-testing, so we need a temporary solution until such time as `swift test` is taught about us. To try it out: ``` SWT_SELECTED_TAGS='trait' swift test ``` Will run only those tests with the `"trait"` tag. If both `"SWT_SELECTED_TAGS""` and `"SWT_SELECTED_TEST_IDS"` are specified, a test must have (at least one of) the given tags _and_ be selected by ID. Whether or not this is the right way to combine these environment variables is, to be polite, probably uninteresting since this is not meant to be a permanent solution. This change also implements `==` and `hash(into:)` on `Tag` as they were previously synthesized which would cause them to consider the internal `sourceCode` property, which was not intentional.
grynspan
added a commit
that referenced
this pull request
Oct 25, 2023
This PR is a follow-on to #77. It adds the ability to filter tests to just the ones that contain a given tag using an environment variable. As before, `swift test --filter` is unaware of swift-testing, so we need a temporary solution until such time as `swift test` is taught about us. To try it out: ``` SWT_SELECTED_TAGS='trait' swift test ``` Will run only those tests with the `"trait"` tag. If both `"SWT_SELECTED_TAGS""` and `"SWT_SELECTED_TEST_IDS"` are specified, a test must have (at least one of) the given tags _and_ be selected by ID. Whether or not this is the right way to combine these environment variables is, to be polite, probably uninteresting since this is not meant to be a permanent solution. This change also implements `==` and `hash(into:)` on `Tag` as they were previously synthesized which would cause them to consider the internal `sourceCode` property, which was not intentional.
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.
Because SwiftPM is not (yet) aware of swift-testing,
swift test --filterdoes not have any effect on swift-testing tests. This PR adds temporary support for an environment variable,"SWT_SELECTED_TEST_IDS", to stand in for--filteruntil such time as SwiftPM can be modified to support swift-testing.Note that the supported value of this environment variable is (intentionally) constrained to just test IDs right now. Matching display names or other metadata about tests is certainly possible, but it's beyond the scope of today's PR.