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
This makes it clear which package is being tested as the test output is printed.
For example, at the end of
=== RUN TestFoo
--- PASS: TestFoo (0.00s)
PASS
ok example.com/foo 0.138s
=== RUN TestBar
which package are we in? We don't know from the output. For large projects, where there are too many packages to memorize, especially their lexicographic order, this is valuable when you spot output you immediately want to investigate, but it takes a long time for the full package testing to finish, at which point the actual package path is printed out.
So, it would instead be something like
=== RUN example.com/foo
=== RUN TestFoo
--- PASS: TestFoo (0.00s)
--- PASS: example.com/foo 0.138s
=== RUN example.com/bar
=== RUN TestBar
The text was updated successfully, but these errors were encountered:
Perhaps the new -fullpath flag added for #37708 covers your use case?
You've shown a passing test, but that's usually uninteresting.
With a failing test it would print
--- FAIL: TestXXX (0.00s)
example.com/testrepo0295/main_test.go:6: it broke
FAIL
exit status 1
FAIL example.com/testrepo0295 0.001s
@seankhliao I think that would indeed solve the problem in most cases, but only if you think to use -fullpath in the first place. If the current verbose test output format won't be changed, then I suppose remembering to use -fullpath is no worse than remembering to use a new -printpkg flag for the proposed behavior.
One case where it wouldn't work is if t.FailNow() is used without other output, which is probably rare, but still possible:
=== RUN TestCreate
--- FAIL: TestCreate (0.00s)
=== RUN TestDelete
--- FAIL: TestDelete (0.00s)
I didn't understand from #37708 the reason why changing the output format would break anyone. I could understand that position for changing the JSON format, but what would break if, say, a === RUN pkg/path line was added?
I do like the symmetry of before/after package delimiters for package results, like we have for tests, but perhaps that's just me.
This makes it clear which package is being tested as the test output is printed.
For example, at the end of
which package are we in? We don't know from the output. For large projects, where there are too many packages to memorize, especially their lexicographic order, this is valuable when you spot output you immediately want to investigate, but it takes a long time for the full package testing to finish, at which point the actual package path is printed out.
So, it would instead be something like
The text was updated successfully, but these errors were encountered: