Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Create launch configuration from selected Test function #879

Closed
dolmen opened this issue Mar 21, 2017 · 2 comments
Closed

Create launch configuration from selected Test function #879

dolmen opened this issue Mar 21, 2017 · 2 comments
Labels

Comments

@dolmen
Copy link

dolmen commented Mar 21, 2017

In files named *_test.go a right click on a function named Test* with signature func (t *testing.T) would show a menu entry allowing to inject a Launch Configuration or to run it if it already exists.

@ramya-rao-a
Copy link
Contributor

Today you can use the configuration snippets in the launch.json file to add a configuration for debugging a test function. Just start typing "Go" and you will get suggestion items for config snippets.

It should be pretty straightforward to add a command that makes use of the config snippet, and plugs in the name of the test function under the cursor.

As far as debugging the test under the cursor, I think we can use the command "go.debug.startSession" and pass in the config

Am a little busy this week and the next week, so might not be able to get to this.
PRs are welcome though, and I am available to help out if anyone wants to take stab at this and needs help

@ramya-rao-a
Copy link
Contributor

With the latest update (0.6.60), you can now debug tests via the codelens.

This is for simple cases only.

If you have cases like env vars being set in your launch.json, the codelens will not be using it.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants