Skip to content

Commit

Permalink
Cleanup: remove spotbugs test only active < Gradle 7.0
Browse files Browse the repository at this point in the history
Gradle 7.1 is now the minimum supported version
  • Loading branch information
sghill committed Nov 20, 2023
1 parent 6e05312 commit 7d01863
Showing 1 changed file with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.jenkinsci.gradle.plugins.jpi

import org.gradle.testkit.runner.TaskOutcome
import org.gradle.util.GradleVersion
import spock.lang.Requires

class SpotBugsPluginSpec extends IntegrationSpec {

Expand All @@ -23,7 +21,6 @@ class SpotBugsPluginSpec extends IntegrationSpec {
TestSupport.PASSING_TEST.writeTo(inProjectDir('src/test/java'))
}

@Requires({ gradle7AndAbove() })
def "should not run SpotBugs tasks by default (Gradle 7)"() {
given:
build << """jenkinsPlugin {
Expand All @@ -40,7 +37,6 @@ class SpotBugsPluginSpec extends IntegrationSpec {
result.task(':spotbugsTest') == null
}
@Requires({ gradle7AndAbove() })
def "should run SpotBugs tasks with default and generate only xml"() {
given:
build << """
Expand All @@ -61,7 +57,6 @@ class SpotBugsPluginSpec extends IntegrationSpec {
!existsRelativeToProjectDir('build/reports/spotbugs/main.html')
}
@Requires({ gradle7AndAbove() })
def "should override default SpotBugs config"() {
given:
build << """
Expand Down Expand Up @@ -89,30 +84,4 @@ class SpotBugsPluginSpec extends IntegrationSpec {
result.task(':spotbugsMain').outcome == TaskOutcome.SUCCESS
existsRelativeToProjectDir('build/reports/spotbugs/main/spotbugs.html')
}
@Requires({ belowGradle7() })
def "should not run SpotBugs tasks and not fail (Gradle 6)"() {
given:
build << """jenkinsPlugin {
jenkinsVersion = '${TestSupport.RECENT_JENKINS_VERSION}'
}""".stripIndent()
when:
def result = gradleRunner()
.withArguments('build')
.build()
then:
result.task(':spotbugsMain') == null
result.task(':spotbugsTest') == null
}
static boolean gradle7AndAbove() {
gradleVersionForTest >= GradleVersion.version('7.0')
}
static boolean belowGradle7() {
!gradle7AndAbove()
}
}

0 comments on commit 7d01863

Please sign in to comment.