-
Notifications
You must be signed in to change notification settings - Fork 645
Separate build-tags and test-tags #1842
Comments
When you say you'd like to test your code on save, are you referring to the linter and syntax checks or actual tests that are run? |
Well both of it, but I am referring to actual tests being run. As long as the tests are simple unit tests they run fast enough, but of course they only run if the linter and syntax checks pass :) |
I would suggest the below:
Set up a test task to run just all tests. Tasks have no knowledge of the go extension and so no knowldge of its settings.
See https://code.visualstudio.com/Docs/editor/tasks to learn more about tasks |
Oh wait, my bad. The You can use a small variation of the above.
You can now run the task on demand every once in a while to get feedback on errors or to run the tests themselves |
Great, but then we are back full-circle. I still wont have linting and syntax checks on my test files unless I run it manually, which I already do today - task or not -. I think that adding proper support for this would be great, especially considering that both Atom and GoLand covers this use-case. I really like VS-Code and wouldn't want to switch editors just because of this. |
Adding proper support is definitely not off the table, I was just brainstorming ideas before we get there. We can definitely add a new setting called |
Much appreciated, for trying to help out and find alternative solutions! Yeah that would be super, if you are stretched for time I could look into it this weekend. |
I would very much appreciate a PR :) Below are some code pointers:
|
Thanks! If I havent submitted anything by the end of the weekend you can
consider me MIA hehe
…On Tue, 14 Aug 2018 at 21:21, Ramya Rao ***@***.***> wrote:
I would very much appreciate a PR :) Below are some code pointers:
- Build and Debug extension
<https://github.com/Microsoft/vscode-go/wiki/Building,-Debugging-and-Sideloading-the-extension-in-Visual-Studio-Code>
is our wiki on steps for setting up a local dev environment
-
https://github.com/Microsoft/vscode-go/blob/0.6.86/src/testUtils.ts#L156
is the function that is called when running tests.
- You need to add the new setting to the package.json
<https://github.com/Microsoft/vscode-go/blob/0.6.86/package.json#L516-L521>
file
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1842 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AI1mxMzP8hXX2k-rfHWEzQ-yjJl9J8bWks5uQyNJgaJpZM4V6d7e>
.
|
No worries, take your time. |
@ramya-rao-a is this considered closed already or is it only after a release? |
Yes, this can be considered as closed. For people who want to try this, you can use the beta version of this extension until we release an update. |
The new |
Hi!
I have come across a use-case that is not covered by this extension, a use-case that I cannot imagine being alone with.
For many of my Go projects I have integration tests, these are tests that spin up docker containers and take longer to run. I also like to test my code on save.. To let me have the best of two worlds, fast running tests on save and longer integration tests on demand, I tag my integration tests with:
This stops the file from building unless I supply the tag with the build or test command.
Unfortunately this also disables the linting and syntax checks on the file, making it really hard to verify the code is working.
Atom solves this by having an option for build tags for build/install commands and a command for build tags for tests. I am not finding it possible to do a similar configuration with Visual Studio Code. All i find is
go.buildTags
which affects both build and save.Are there any plans to fix that?
The text was updated successfully, but these errors were encountered: