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
{{ message }}
Repository navigation
proposal: testing: expose -fullpath to tests as T.FullPath #81618
I propose adding func FullPath() bool to the testing package, analogous to Short/Verbose/CoverMode, so that a test that reports paths (separate from the path reported by t.Error/t.Log) can change it's behavior based on -fullpath.
/path/to/analysistest.go:123: some_test_file.go:123:45: diagnostic ... does not match any expected diagnostic
As far as why the authors of analysistest decided to use relative paths? If I had to guess, it would be that the tools repo has many deeply nested analyzers, and they felt that reporting full paths was noisy. And that's probably fine when you're running tests manually. But when I'm using something like vscode's testing API to execute tests, relative paths are problematic.
Activity
gabyhelp commentedon Sep 20, 2026
Related Issues
Related Code Changes
Related Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
[-]proposal: testing: expose -fullpath to tests[/-][+]proposal: testing: expose -fullpath to tests as T.FullPath[/+]seankhliao commentedon Sep 22, 2026
I'm having a hard time understanding why you might want this vs always using the full path in non log output
firelizzard18 commentedon Sep 22, 2026
I am debugging a gopls analyzer, which uses golang.org/x/tools/go/analysis/analysistest to test itself. With -fullpath, the output will look something like:
As far as why the authors of analysistest decided to use relative paths? If I had to guess, it would be that the tools repo has many deeply nested analyzers, and they felt that reporting full paths was noisy. And that's probably fine when you're running tests manually. But when I'm using something like vscode's testing API to execute tests, relative paths are problematic.
seankhliao commentedon Oct 2, 2026
cc @adonovan