suppress printing package names with no tests
Is there a way to avoid printing packages when only skipped tests or no tests at all are in package?
Currently there is no way to hide output for empty packages. Are you looking for option for the pkgname format , or one of the others?
Probably pkgname.
I am using -f dots-v2 and in my project there is a lot of packages that have no tests. Printing those packages names gives me no value and pollutes the output.
I used this:
gotestsum -f pkgname-and-test-fails | grep -v ∅
# or
gotestsum -f testname | grep -v EMPTY
but the color is gone
As a workaround to the missing color, you can use this:
gotestsum --no-color=false
I think it would also be ok to add an option to hide empty packages, but I'm not sure yet how that should work.
I made a PR for this, adding a --skip-empty option that only works if you are testing ./..., since that's the probably the only situation where you would want to transparently skip missing tests, and would be the situation where you would encounter them the most. If you're being explicit about testing targets, then you should see output for everything you specify, missing or not.
This was a bit tricky as I had to track missing stuff in two places to intercept it both before it is tracked for summary and before it's streamed to the formatters. In both cases I use the initial output starting with a ? to mark the package as empty from that point forward, after which all entries from that package are dropped. There might be a better method, but this seemed the most straightforward.
Wasn't sure where to add tests beyond arg checking, since AFAICT all of the testing harnesses that do golden file comparison on output are geared strictly to formatters, which my solution bypasses to avoid adding skipping behavior to all formatters.
Done in #288 and #283