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

Golang test are failing while executing on go_binary target in go/BUILD. #5943

Closed
sgowroji opened this issue Jan 11, 2024 · 4 comments
Closed
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues lang: go Go rules integration product: IntelliJ IntelliJ plugin topic: testing type: bug

Comments

@sgowroji
Copy link
Member

Description of the bug:

While performing GoLang test cases from the IntelliJ examples through Go tests are failing.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Open any Bazel Golang project from intelliJ examples (https://github.com/bazelbuild/intellij/tree/master/examples/go/with_proto)
  2. Open Go/Build file in that project
  3. Click on Go Binary to execute GoLang test cases.
  4. The Go test cases are failed.

Which Intellij IDE are you using? Please provide the specific version.

IntelliJ 2023.2.2

What programming languages and tools are you using? Please provide specific versions.

Go Lang

What Bazel plugin version are you using?

Bazel Plugin v2024.01.02

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

Screenshot 2024-01-11 at 11 48 40
@sgowroji sgowroji added type: bug lang: go Go rules integration product: IntelliJ IntelliJ plugin topic: testing awaiting-maintainer Awaiting review from Bazel team on issues labels Jan 11, 2024
@blorente
Copy link
Collaborator

I think this is because macro expansion in test flags has been broken, so some part of https://github.com/bazelbuild/intellij/pull/4368/files got changes or reverted or invalidated.

@blorente blorente added the P1 I'll work on this now. (Assignee required) label Jan 15, 2024
@blorente
Copy link
Collaborator

Alright, I got to the bottom of this. The main issue is that, when running the tests in Debug mode, the test runner doesn't pass the env vars. So it doesn't work in Debug, but it does in Run. We must have changed how we pass flags to the debug runner.
I'm not sure how Debug worked in the first place, but it definitely shouldn't. The flags should be passed via Env var in debug configurations.

Actions from here:

@blorente blorente removed the P1 I'll work on this now. (Assignee required) label Jan 15, 2024
@mai93
Copy link
Collaborator

mai93 commented Jan 15, 2024

Thanks @blorente. I also wanted to add that this test should not be invoked from the BUILD file but from the run configuration that should be already imported because it contains the env var needed.

@tanishktyagii
Copy link
Contributor

We are still seeing this issue in the latest beta version v2024.01.16 .

@mai93 mai93 closed this as completed Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues lang: go Go rules integration product: IntelliJ IntelliJ plugin topic: testing type: bug
Projects
Development

No branches or pull requests

4 participants