How do I run a subset of spock functional tests in grails?
functional-testing, geb, grails, spock, tags
Solution
You could use JUnit suites with `@Category`. Or you could use a `SpockConfig.groovy` with the following contents:
runner {
include foo.bar.FrontEnd, foo.bar.BackEnd
exclude foo.bar.Slow
}
Here, `foo.bar.FrontEnd`, `foo.bar.BackEnd`, and `foo.bar.Slow` are your own annotations. To activate the configuration file, you have to set a `spock.configuration` system property pointing to it.
Problem
In some other testing frameworks I'm used to tagging tests, eg @really_slow, @front_end And then running different batches of tests, like I might want to set up a build slave to run all the really_slow tests, and might want to run all the tests tagged as front end but none that are marked as really slow. To run my spock+geb tests in grails at the moment I just run grails test-app functional: How do I tell it to run a subset?