How to run a single integration test in grails 3?

Grails 3 (at least 3.1.10) does not work well when only certain tests are run. How do I get it to run a single integration test?

+4
source share
3 answers

Here is an example command to run a single integration test

grails test-app *LoginFunctional* -integration

If you put the integration flag in front of the template, the test-app command will ignore the template and run all the integration tests.

+4
source

grails test-app, , , , org.myorg.ClassToTest org.**.*, -unit -integration, . . docs.

Grails 3.1.10 .

1) grails test-app , , . build/reports/tests/index.html, Grails , - .

2) . , grails clean; grails test clean. ( , .)

3) , (2), . , , -integration . , Grails , , , grails . , , -unit , .

4) -Dtest.single=<classname>. , gradle. , -unit, .

+1

I usually use annotation @IgnoreRest. Remember import spock.lang.IgnoreRestand run the test for the specified class.

0
source

Source: https://habr.com/ru/post/1656233/


All Articles