////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

The `create-*` commands in Grails automatically create unit or integration tests for you within the `src/test/groovy` directory. It is of course up to you to populate these tests with valid test logic, information on which can be found in the section on link:testing.html[Unit and integration tests].

To execute tests you run the link:{commandLineRef}test-app.html[test-app] command as follows:

[source,groovy]
----
grails test-app
----


Gradle offers a convenient feature where you can automatically generate unit and integration tests for your application using the `create-*` commands. These generated tests are stored in the `src/test/groovy` and `src/integration-test/groovy` directories. However, it is your responsibility to populate these tests with the appropriate test logic. You can find comprehensive guidance on crafting valid test logic in the section dedicated to link:testing.html[Unit and Integration Tests].

To initiate the execution of your tests, including both unit and integration tests, you can utilize the Gradle `check` task. Follow these steps:

1. Open your terminal or command prompt and navigate to your Grails project's root directory.

2. Execute the following Gradle command:

+
[source,console]
$ ./gradlew check

+
By running the `check` task, you ensure that all tests in your Grails project, including the ones you've created and populated with test logic, are executed. This comprehensive testing approach contributes significantly to the robustness and overall quality of your application.

3. **Viewing Test Reports**: After running your tests, Grails generates test reports that provide valuable insights into the test results. You can typically find these reports in the `build/reports/tests` directory of your Grails project. Open these reports in a web browser to view detailed information about test outcomes, including passed, failed, and skipped tests.

Remember, testing is not just a process; it's a fundamental practice that enhances your Grails application's reliability. Viewing test reports helps you analyze and understand the test results, making it easier to identify and address any issues.

By following these testing practices and reviewing test reports, you can deliver a high-quality Grails application to your users with confidence.
