run a single integration test from a test class

198 Views Asked by At

I have tried to run the command as given in the documentation:

-Dgrails.env=development test-app -integration MyClass.\"create new test thingy from search page\"

However, this results in ALL the integration test running for that class, instead of only running the named test. I have also tried to rename the test to no spaces, but toi the same result.

It is the same behavior in eclipse or from the command line (Windows).

Has anyone else experienced this issue, and, if so, did you find a workaround?

2

There are 2 best solutions below

0
On BEST ANSWER

This facility is not available yet. For a workaround, you can use IgnoreRest annotation (Indicates that all feature methods except the ones carrying this annotation should be ignored), like

@IgnoreRest
def "should test something"() {
    ...
} 

Ref. Run single Spock test in Grails

0
On

Try the same without the '\'. e.g. :

grails test-app -integration MyClass."create new test thingy from search page"

Also, you don't need to specify the environment for development. It's the default.