go test -run does not work for a particular test
eginez opened this issue ยท 7 comments
I have a test suite made of a couple of test, I'd like to run only one test with go test -run regex
but go test is not finding the test
you need to use -testify.m to specify your test:
go test -run TestYourTestSuiteMethod -testify.m TestYourIndividualMethod
TestYourTestSuiteMethod is the method where it calls suite.Run(t, new(YourTestSuite))
ahh thanks!
That didn't work for me (also the docs mention -m and not -testify.m; but never mind).
Looks like the testify flag is being ignored.
Just for the record: it works, but the order of the flags is relevant.
It did work for me like this:
go test -run TestYourTestSuiteMethod ./package -testify.m TestYourIndividualMethod
If I don't specify the package, go test won't find any package when the -testify.m flag is processed.
Is there a way to make goland recognize the individual test methods in a suite as well, so they can be run individually from inside the IDE using the green play button?