forked from abayer/gradle-hpi-plugin
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Consolidate the GradleTestKit setup in one place - Add `testGradle<ID>` rule so we can re-use our GradleTestKit specs to verify behavior works on all supported versions of Gradle on each build - Exclude Gradle 4.10.3 from running on Java 11 (Gradle 5.0 is required) - Run all tests against the last major and each minor of the current major
- Loading branch information
Showing
8 changed files
with
80 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/test/groovy/org/jenkinsci/gradle/plugins/jpi/IntegrationSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jenkinsci.gradle.plugins.jpi | ||
|
||
import groovy.transform.CompileStatic | ||
import org.gradle.testkit.runner.GradleRunner | ||
import org.junit.Rule | ||
import org.junit.experimental.categories.Category | ||
import org.junit.rules.TemporaryFolder | ||
import spock.lang.Specification | ||
|
||
@CompileStatic | ||
@Category(UsesGradleTestKit) | ||
class IntegrationSpec extends Specification { | ||
@Rule | ||
protected final TemporaryFolder projectDir = new TemporaryFolder() | ||
|
||
protected GradleRunner gradleRunner() { | ||
def runner = GradleRunner.create() | ||
.withPluginClasspath() | ||
.withProjectDir(projectDir.root) | ||
if (System.getProperty('gradle.under.test')) { | ||
return runner.withGradleVersion(System.getProperty('gradle.under.test')) | ||
} | ||
runner | ||
} | ||
} |
36 changes: 13 additions & 23 deletions
36
src/test/groovy/org/jenkinsci/gradle/plugins/jpi/JpiLocalizerTaskIntegrationSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 3 additions & 10 deletions
13
src/test/groovy/org/jenkinsci/gradle/plugins/jpi/LicenseTaskSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/test/groovy/org/jenkinsci/gradle/plugins/jpi/UsesGradleTestKit.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.jenkinsci.gradle.plugins.jpi | ||
|
||
interface UsesGradleTestKit { | ||
} |