intellij: "Illegal Character" trying to debug go_test, and passing tests don't show up when run.
The problem occurs when run a test in Goland from the “Run/Debug configurations” using bazel test.
If I just run, then the tests run and I can see the results on the console, but the test navigator says “No tests were found” (if they all pass)
Note that I have “show passing tests” selected, so the passing tests are expected to show up.
Interestingly, if I change one of the tests to fail, I get…
so the failing test shows up and the passing ones do not.
But the original issue I had is that I’m not able to debug. If I click the debug button I get:

I tried upgrading the bazel plugin (and Goland) since I saw that fixing debugging with go_test was on the list of recent fixes, but the issue persists after all of that, plus doing bazel clean and even nuking my output-user-root directory to force everything to rebuild.
Also note that the illegal character remains at index 116 even if I change the test to have everything commented out, leaving only one empty test method.
Throughout all of this, bazel build and bazel test continue to work from the terminal as expected.
Versions: Goland: 2022.1 Bazelisk: 1.11.0 Bazel: 5.1.1 Bazel Plugin: 2022.04.28.0.0-api-version-221
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 26 (10 by maintainers)
Commits related to this issue
- fix: "Illegal Character" trying to debug go_test, and passing tests don't show up when run. (#3555) — committed to iliakondratev/intellij by iliakondratev 2 years ago
- fix: "Illegal Character" trying to debug go_test, and passing tests don't show up when run. (#3555) (#6938) — committed to bazelbuild/intellij by iliakondratev 2 years ago
Rechecked with updated Bazel plugin and confirmed the issue still occurs.
Created https://github.com/bdleitner/illegal_char_demo to demo, with code+screenshots.