"Fossies" - the Fresh Open Source Software Archive

Member "grails-core-5.2.4/grails-docs/src/test/resources/docs/ref/Command Line/test-app.html" (14 Sep 2022, 60489 Bytes) of package /linux/www/grails-core-5.2.4.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the grails-core-5.2.4.tar.gz project site itself.

(Quick Reference)

test-app

Purpose

Runs all Grails unit and integration tests and generates reports. The command returns appropriate response codes for embedding with continuous integration servers.

Examples

grails test-app
grails test-app Foo
grails test-app Foo Bar

Description

Usage:

grails <<environment>>* test-app <<names>>*

Fired Events:

Executes the Grails unit and integration tests located in the src/test/groovy and src/integration-test/groovy directories. By default all tests are executed, but you can specify the names of the tests (without the "Tests" or other test type suffix) as argument to the command:

grails test-app *Foo*
grails test-app *Foo* *Bar*

The first example will execute a test called FooSpec.groovy whilst the second will execute FooSpec.groovy and BarSpec.groovy if they exist.

The task of finding tests that match the pattern you provide is passed to Gradle. Take a look at the section in their docs titled Test filtering for more information.

You can also choose to only run the unit or integration tests:

grails test-app -unit
grails test-app -integration

If you only wish to re-run failed tests use the -rerun flag

grails test-app -rerun

See the Testing section for examples on how to combine the different options to target tests.