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

Escape regex-relevant characters in test filter #5745

Merged

Conversation

illicitonion
Copy link
Contributor

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: #5744

Description of this change

Go tests can contain arbitrary characters because they're not tied to a symbol name in a source file. Accordingly, they may contain characters which have special meaning for regexes. Because the Go test runner interprets this flag as a regex, we need to escape these.

Without this, running a single test from the gutter, Bazel will exit 0 and look happy, but it won't have actually run the test (which perhaps would have failed if it had run).

Go tests can contain arbitrary characters because they're not tied to a
symbol name in a source file. Accordingly, they may contain characters
which have special meaning for regexes. Because the Go test runner
interprets this flag as a regex, we need to escape these.

Without this, running a single test from the gutter, Bazel will exit 0
and look happy, but it won't have actually run the test (which perhaps
would have failed if it had run).
@github-actions github-actions bot added product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Nov 21, 2023
@blorente blorente merged commit 4fa29cf into bazelbuild:master Dec 4, 2023
8 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Dec 4, 2023
@illicitonion illicitonion deleted the go-test-names-with-regex-chars branch December 5, 2023 11:05
sgowroji added a commit that referenced this pull request Dec 6, 2023
* Escape regex-relevant characters in test filter #5745
* Mitigate StartupActivity warnings #5760
sgowroji added a commit that referenced this pull request Dec 6, 2023
* Update CHANGELOG for 2023.12.05 release

* Update CHANGELOG with 2 more fixes.


* Escape regex-relevant characters in test filter #5745
* Mitigate StartupActivity warnings #5760

---------

Co-authored-by: Gowroji Sunil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: GoLand GoLand plugin
Projects
Development

Successfully merging this pull request may close these issues.

2 participants