NightlyTestsPlugin
Gradle Plugin to configure which (j)Unit tests should only be run nightly and not everytime a CI/CD pipeline is triggered.
Usage
To find out how to apply this plugin to your Gradle project see the information over at the Gradle Plugin Portal!
Configuration
One necessary parameter needed otherwise the use of the plugin is useless and instantly fails. The parameter must be set in the projects own gradle.properties file.
# Which test classes should me handled only when running a nightly build
# list is separated using ","
plugins.nightlytests.listOfTests=List<String>
To enable this exclusion of tests only run nightly you must add a system property to the Gradle task call:
gradlew test -DBUILDSERVER=NIGHTLYBUILD
The value of the environment doesn't matter while it contains anything with nightly (case-insensitive)!