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: Out of Sync / right-click test configurations #214

Closed
promiseofcake opened this issue Jan 17, 2018 · 10 comments
Closed

Golang: Out of Sync / right-click test configurations #214

promiseofcake opened this issue Jan 17, 2018 · 10 comments
Labels
lang: go Go rules integration

Comments

@promiseofcake
Copy link

Versions: IDEA Ultimate 2017.3.3 / 2018.01.02.0.1
          IDEA Ultimate 2017.3.1 / 2017.11.20.0.4

We are missing the right-click Run/Debug options in Golang projects that we have for Java/Scala.

We can execute tests form the corresponding BUILD file, but not from the context of the test file itself either as a whole unit or an individual method.

It also appears that the Workspace is frequently out-of-sync (via the light in the toolbar).

Sample .bazelproject:

directories:
  .

targets:
  //...

additional_languages:
  go

I am interesting in contributing, would we just need to port somethings over from the Java/Scala invocations?

@chaoren
Copy link
Collaborator

chaoren commented Jan 17, 2018

You don't see these from right clicking?
screenshot from 2018-01-17 14-30-58
screenshot from 2018-01-17 14-31-28

Can you share your project? Or a minimal repro case?

@promiseofcake
Copy link
Author

Thanks for the reply @chaoren, yeah I am missing those options. Let me see if I can create a reproducible example outside our private monorepo context.

@promiseofcake
Copy link
Author

promiseofcake commented Jan 17, 2018

@chaoren, here is one of our public projects that I was able to repro the issue with:
https://github.com/vsco/domino

I setup the project via:

  • Import Bazel Proejct
  • Use existing workspace (GOPATH to repo)
  • Create project view from scratch (using above)
  • Re-syncing project / allow indexing to complete

Via TestGetItemEmpty:
screen shot 2018-01-17 at 2 41 57 pm

Via BUILD
screen shot 2018-01-17 at 2 40 20 pm

@chaoren chaoren added the lang: go Go rules integration label Jan 17, 2018
@chaoren chaoren self-assigned this Jan 17, 2018
@chaoren
Copy link
Collaborator

chaoren commented Jan 17, 2018

Problem seems to be in rules_go.
ctx.rule.attr is empty for go_test targets.

@chaoren
Copy link
Collaborator

chaoren commented Jan 17, 2018

@promiseofcake
Copy link
Author

Thank you @chaoren 👍 !

@chaoren
Copy link
Collaborator

chaoren commented Jan 18, 2018

Bad news. Those providers are not usable unless we load their definitions from the rules_go repo into our aspect, but we also run the aspect for non-go workspaces, and there's no such thing as a conditional load. We'll need to talk with the bazel people about potentially changing the providers API.

@chaoren chaoren removed their assignment Jan 18, 2018
@promiseofcake
Copy link
Author

Is the rules_go project the only one that is not following the same convention for those providers? It would seem that in that case if let's say rules_scala made a similar change we would lose functionality there as well right?

@brendandouglas
Copy link
Contributor

We're in discussions with the Skylark folks now to come up with a solution for this (likely adding support for a conditional load).

The only reason our plugin currently works for java-like languages (java, scala, kotlin) is that the java providers we use are bundled with Bazel. This is something we're going to have to solve for all languages.

@promiseofcake
Copy link
Author

It works as of the latest plugin and IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: go Go rules integration
Projects
None yet
Development

No branches or pull requests

3 participants