How to run a subset of spock function tests in grails?

In some other testing environments, I use tagging, e.g. @really_slow, @front_end

And then run different batches of tests, for example, I can configure the build list to run all the tests in reality, and you might want to run all the tags marked as front but not marked as very slow.

To run spock + geb tests in grails, I just run the grails test application:

How do I say to run a subset?

+4
source share
1 answer

You can use JUnit packages with @Category . Or you can use 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 need to set the spock.configuration system property that points to it.

+3
source

All Articles