Skip to content
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

Stop adding a trailing # when filtering tests for JUnit 5 #7060

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

joca-bt
Copy link
Contributor

@joca-bt joca-bt commented Nov 26, 2024

The JUnit 5 selector for methods does not support a trailing #.

This is easy to verify:

> java -jar junit-platform-console-standalone-<version>.jar execute -cp <my tests jar> --select-class=<my test class>

will work, while

> java -jar junit-platform-console-standalone-<version>.jar execute -cp <my tests jar> --select-class=<my test class>#

will fail.

This will change --test_filter's value from <my test class># to <my test class> when filtering for classes. The new value requires no postprocessing and is directly compatible with JUnit's selector "language".

The trailing # was introduced in #4473. This undocumented breaking change created issues for our own test runner.

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.

Discussion thread for this change

Issue number: #7061

Description of this change

@github-actions github-actions bot added product: IntelliJ IntelliJ plugin awaiting-review Awaiting review from Bazel team on PRs labels Nov 26, 2024
@tpasternak
Copy link
Collaborator

wow, great finding!

@joca-bt joca-bt force-pushed the master branch 2 times, most recently from e333007 to a24c610 Compare November 26, 2024 12:49
@joca-bt
Copy link
Contributor Author

joca-bt commented Nov 26, 2024

Updated the failing tests.

The JUnit 5 selector for methods does not support a trailing #.

This is easy to verify:

```
> java -jar junit-platform-console-standalone-<version>.jar execute -cp <my tests jar> --select-class=<my test class>
```

will work, while

```
> java -jar junit-platform-console-standalone-<version>.jar execute -cp <my tests jar> --select-class=<my test class>#
```

will fail.

This will change `--test_filter`'s value from `<my test class>#` to `<my test class>` when filtering for classes. The new value requires no postprocessing and is directly compatible with JUnit's selector "language".

The trailing # was introduced in #4473. This undocumented breaking change created issues for our own test runner.
@tpasternak tpasternak merged commit e004ffe into bazelbuild:master Nov 27, 2024
5 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: IntelliJ IntelliJ plugin
Projects
Development

Successfully merging this pull request may close these issues.

3 participants