gotestsum
gotestsum copied to clipboard
Path `./...` does not respect the default of ignoring the vendor directory
When running a command like gotestsum --format testname -- -tags integration -race -shuffle=on ./... I am seeing output from the vendor directory which should be ignored.
I'd expect it to respect the default rules of the Go cli, which ignore dot prefix, underscore prefix, and the vendor directory.
edit: go test ./... -cover -shuffle on -race -v also seems to not honor this so I'll close this out as soon as I figure out why so if anyone runs into it they know why.
That is unexpected. gotestsum does not handle the ./... at all, it passes it as an arg directly to go test. I tried to reproduce by running go mod vendor first and then gotestsum -- ./... and I don't see it running tests in vendor.
Going to test further. I didn't expect this behavior either but it was timing out the pipeline builds in CI with this. I'll post an update once If figure this out in case others benefit. Cheers
facing same issue where the gotestsum --format=testname -- ./... does not ignores the vendor/generated files includes them , even after explicitly defining exclusion.
Thanks for the report! Can you provide some more information about your environment (full output of go version), and what happens if you run go test ./... in that same environment?
gotestsum does not interpret the ./... , it passes it directly to go test -json, so whatever is causing this is likely the behaviour of the go toolchain.
Thanks for the report! Can you provide some more information about your environment (full output of
go version), and what happens if you rungo test ./...in that same environment?
gotestsumdoes not interpret the./..., it passes it directly togo test -json, so whatever is causing this is likely the behaviour of the go toolchain.
Thanks for the clarification , does this mean if we are required to exclude vendor dir in gotestsum we can follow same approach as in go test $(go list ./... | grep -v vendor)
Please find details requested.
go version go1.17.8 darwin/amd64 : go -version
result from go test ./...
it runs all the test including vendors to exclude the vendor dir in go test go test ./... $(go list ./... | grep -v vendor)
That you for confirming that go test also runs the tests in vendor!
I think you found a good workaround for the problem. I'm not sure why it does this, but it does seem to be an issue with go test.