Skip to content

Commit

Permalink
Do not run DeGraph as part of standard test task
Browse files Browse the repository at this point in the history
Prior to this commit, the slow DeGraph dependency tests were always
executed via the standard Gradle `test` task. The only way to execute
all tests without DeGraph was to execute `gradlew test -x :test` which
is not very intuitive for most developers.

This commit addresses this issue by introducing a new (empty) `degraph`
task in the root project which acts as an "alias" for the
`junitPlatformTest` task.

In addition, the dependency from the standard `test` task to the
`junitPlatformTest` task has been removed for the root project, and a
dependency from the `check` task to the `degraph` task has been added
for the root project.

Consequently, executing `gradlew test` will no longer run the DeGraph
tests, but executing `gradlew degraph` or `gradlew check` will.

Issue: #481
  • Loading branch information
sbrannen committed Aug 27, 2016
1 parent e0b3cec commit d268d9f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build.gradle
Expand Up @@ -418,6 +418,26 @@ configure(rootProject) {
logManager 'org.apache.logging.log4j.jul.LogManager'
}

task degraph() {
description = 'Runs DeGraph tests.'
// configured in afterEvaluate
}

afterEvaluate {
// The following is a hack which allows the custom `degraph`
// task to serve as an "alias" for the `junitPlatformTest` task.
// In addition, the following removes the dependency from the
// `test` task to the `junitPlatformTest` task (which is
// created by the JUnit Platform Gradle Plugin) and adds a
// dependency from `check` to `degraph`. Consequently,
// executing `gradle test` will not run the DeGraph tests, but
// `gradle degraph` or `gradle check` will.
def junitPlatformTestTask = tasks.getByName('junitPlatformTest')
degraph.dependsOn(junitPlatformTestTask)
test.dependsOn.remove(junitPlatformTestTask)
check.dependsOn(degraph)
}

task aggregateJavadocs(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadocs"
Expand Down

0 comments on commit d268d9f

Please sign in to comment.