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

Support run as Bazel Target via right-click on file in Package Explorer #38

Closed
plaird opened this issue Dec 19, 2019 · 2 comments · Fixed by #75
Closed

Support run as Bazel Target via right-click on file in Package Explorer #38

plaird opened this issue Dec 19, 2019 · 2 comments · Fixed by #75
Assignees

Comments

@plaird
Copy link
Contributor

plaird commented Dec 19, 2019

As a BEF user
I would like to right click on my Java file in the Package Explorer
Such that I have an option to Run As -> Bazel Target

Background:
(Salesforce internal) we once had this working via a class plugin-core/.../launcher/BazelJunitTargetLaunchShortcut.java in the old bazel-eclipse repo (go back to commits in Oct 2019). It wasn't working before we cut to the public repo, so it was removed temporarily.

When working this ticket, consider that we also want to be able to run 'all tests' in one action using the right-click UX. Either incorporate that into this work, or create a follow up Issue to address that.

@plaird
Copy link
Contributor Author

plaird commented Dec 19, 2019

Salesforce internal: we had right-click launchers working at one point, but it was broken at time of transition to public, so the code we had for it was pulled. Look for BazelJunitTargetLaunchShortcut.java in the internal repo in older history. Also, this Issue has a set of internal shadow tickets that all map to this feature. Search on #38 and you find them.

@dnishant-zz dnishant-zz linked a pull request Mar 11, 2020 that will close this issue
@plaird
Copy link
Contributor Author

plaird commented Mar 25, 2020

This feature was implemented with this UI:

  • in the Package Explorer, click on the test folder (src/test/java), a test Java package (com.salesforce.hello), or a specific test class (HelloWorldTest.java)
  • right click on it, and find the 'Run As' or 'Debug As' item in the context menu
  • choose 'JUnit Bazel Target'
  • the JUnit view will populate with the test results

If the Run/Debug As context menu does not appear, or throws an error, it is likely due to #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants