You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I am using gopls in VSCode and have the following issue/question detailed below. Hopefully, this is the correct place to report, if not please direct to correct place to submit query/issue.
What version of Go are you using (go version)?
$ go version go1.15.7 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
I have implemented some integration tests using testify/suite. The tests in the test suite are split across files organised by feature as opposed to bunching them all together in one large file. I can confirm that the all tests in the suite run through the terminal using go test command.
However, within VSCode the links for running and debugging each test are not displayed across all files that contain tests in the test suite:
Declare the test suite struct and any test hooks (before, after etc.) in a separate source file, e.g.testsuite.go.
Create separate files for testing each feature: feature_1_tests.go, feature_2_tests.go etc. These contain the tests for the test suite organised by feature, e.g.:
Declare function in feature_1_tests.go for running the test suite:
// TestIntegrationTestSuite for 'go test' to run this suite, we need to create// a normal test function and pass our suite to suite.RunfuncTestIntegrationTestSuite(t*testing.T) {
suite.Run(t, new(IntegrationTestSuite))
}
Links for running and debugging the test are displayed in VSCode within go_feat1_integration_test.go. However, there are no links for creating and debugging tests displayed for the tests in file feature_2_test.go.
What did you expect to see?
It should be possible to see links for running and debugging tests across all files that contain tests for a test suite in VSCode. How to achieve this?
What did you see instead?
Run and debug links are only shown on the test file that contains the function to start the test suite:
// In order for 'go test' to run this suite, we need to create// a normal test function and pass our suite to suite.RunfuncTestIntegrationTestSuite(t*testing.T) {
suite.Run(t, new(IntegrationTestSuite))
}
The text was updated successfully, but these errors were encountered:
The test code lenses depend on vscode's DocumentSymbolProvider implementation (Code). Unfortunately, DocumentSymbolProvider API is designed around a single document, so this cannot handle your use case.
When we eventually implement PackageSymbolProvider, that may be possible.
When evaluating whether a symbol is a document or not, check if testify was imported by any file of the directory (which is the go package).
Fixesgolang#1130
nirhaas
added a commit
to nirhaas/vscode-go
that referenced
this issue
Jul 2, 2022
When evaluating whether a symbol is a document or not, check if testify was imported by any file of the directory (which is the go package).
Fixesgolang#1130
When evaluating whether a symbol is a document or not, check if testify was imported by any file of the directory (which is the go package).
Fixesgolang#1130
Hi I am using gopls in VSCode and have the following issue/question detailed below. Hopefully, this is the correct place to report, if not please direct to correct place to submit query/issue.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have implemented some integration tests using testify/suite. The tests in the test suite are split across files organised by feature as opposed to bunching them all together in one large file. I can confirm that the all tests in the suite run through the terminal using
go test
command.However, within VSCode the links for running and debugging each test are not displayed across all files that contain tests in the test suite:
testsuite.go
.feature_1_test.go
feature_2_test.go
Links for running and debugging the test are displayed in VSCode within go_feat1_integration_test.go. However, there are no links for creating and debugging tests displayed for the tests in file feature_2_test.go.
What did you expect to see?
It should be possible to see links for running and debugging tests across all files that contain tests for a test suite in VSCode. How to achieve this?
What did you see instead?
Run and debug links are only shown on the test file that contains the function to start the test suite:
The text was updated successfully, but these errors were encountered: