-
Notifications
You must be signed in to change notification settings - Fork 701
Allow version-tagged filepaths in tests #167
Comments
I don't think it's going to be possible to support the I know there is a bug related to tidying up the prefix reported by Func.FileLine, but I don't think solving the |
What is the argument against running |
Thank you for highlighting golang/go#26317 , I'll have to change the tests to work in this manner. I don't have an ETA for that, patches welcome. |
I had a go at this; I didn't find a better way to determine the correct source paths in the stack traces than the one given in #165. Without a better way, I think #165 is right on the money. |
Hey, I just want to add an explanation for why I think supporting |
(Continued from PR #165).
Description
Go 1.11 will introduce support for versioned modules. When running in module-aware mode, if your package depends on
github.com/pkg/errors
then Go will download it into a.../github.com/pkg/errors@v0.8.0/
path (or whatever the requested version). This makesformat_test.go
andstack_test.go
fail duringgo test all
because they expect the filepaths to contain/github.com/pkg/errors/
.Steps to reproduce
go1.11rc1 mod init github.com/thsnr/gomod
.go1.11rc1 get github.com/pkg/errors@v0.0.0-00000000000000-816c9085562cd7ee03e7f8188a1cfd942858cded
(must use pinned commit because 0.8.0 fails with another error fixed in master).go1.11rc1 test github.com/pkg/errors
(usually run duringgo test all
).Expected results
All tests pass.
Actual results
Some tests fail because they are on a
github.com/pkg/errors@v<version>
path:The PR simply proposed allowing version tags in the filepaths in those tests. It was closed because of "a broader problem with assuming the prefix is stable" and "the logic to trim the compile time GOPATH from source file paths" no longer working.
However I am unsure how these issues are relevant as the
github.com/pkg/errors
package does not assume a stable prefix outside of these tests and no GOPATH trimming is performed: it simply prints the filename reported by Func.FileLine (although see #166).Opening this issue to continue the discussion from #165.
The text was updated successfully, but these errors were encountered: