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
I created testdata including a test file (a file suffixed _test.go) and then I created a test and used analysistest.Run to test this code.
What did you expect to see?
Only my files from the testdata to be passed to the analyzer run function.
What did you see instead?
The generated test file(s) in the build cache gets passed.
The problem for me is that the analyzer I've created adds a diagnostics report on the test code generated in cache and thus I cannot get my test to pass. I guess this might be related to #40574.
% go test ./... -v
go test ./... -v
=== RUN TestA
testing /Users/simon.sawert/Library/Caches/go-build/00/0090ea545eb3074c3efc79841f1af52ecd6009c127392415405c05125895f58a-d
testing /Users/simon.sawert/git/analyzer-mre/testdata/src/mypackage/mypackage.go
testing /Users/simon.sawert/git/analyzer-mre/testdata/src/mypackage/mypackage.go
testing /Users/simon.sawert/git/analyzer-mre/testdata/src/mypackage/mypackage_test.go
--- PASS: TestA (0.96s)
PASS
ok analyzer-mre 1.258s
The text was updated successfully, but these errors were encountered:
gopherbot
added
the
Tools
This label describes issues relating to any tools in the x/tools repository.
label
Oct 3, 2020
Oh, this isn't related to the analysistest in any way, it's the analyser itself! Running the same code on a package containing tests will have the same result. Closing this and will try to figure out how I can avoid these getting passed to the analyser completely.
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 created testdata including a test file (a file suffixed
_test.go
) and then I created a test and usedanalysistest.Run
to test this code.What did you expect to see?
Only my files from the testdata to be passed to the analyzer run function.
What did you see instead?
The generated test file(s) in the build cache gets passed.
The problem for me is that the analyzer I've created adds a diagnostics report on the test code generated in cache and thus I cannot get my test to pass. I guess this might be related to #40574.
Here's an minimal reproducible example:
% tree . ├── amre.go ├── amre_test.go └── testdata └── src └── mypackage ├── mypackage.go └── mypackage_test.go 3 directories, 6 files
The text was updated successfully, but these errors were encountered: