Gradle's check task
One of the things I completely missed when I was learning Gradle was the
check task that is added to your project when you apply
java plugin to it. This is a pretty useful task and I really like the convention behind it.
The documentation of the task says that it depends on "all verification tasks in the project, including test. Some plugins add additional verification tasks to the project". That is the case for example for
codenarc plugin which adds dependencies on its tasks to the
check task. Thanks to that when executing
check task both your tests and CodeNarc verifications will be run.
I also applied that convention when I added
gaeFunctionalTest task to Gradle GAE plugin - so running
check task will execute both your unit and functional tests.
You should also always add a dependency to
check task on any of your new tasks that verify your project.