I would like to separate my integration tests from the unit tests. I have read that I can do it including tags in the test file:
// +build integration
On the other hand, I select all the packages from my project by using wildcards ./...
Unfortunately, I have problems, tags are ignored because of the wildcard.
go test ./... -tags=integration
or
go test -tags=integration ./...
Do you have any solution or alternative to it?
Update 2021
This Just Works now! But I did run into an issue where the tags are ignored if there is a
TestMain
function in the file. So if you're having this issue now, check for that. For the record I run with:go test -tags="all your tags here" -v -count=1 ./...
Hopefully this helps someone in the future