Skip to content

Commit

Permalink
[tests] Add spock ignoreIf not java 11 to tests that fail on newer jd…
Browse files Browse the repository at this point in the history
…ks (#1005)

Be very explicit on tests compatibility.  Sure tool chains can be used but it hides direct fact these are not compatible.  So lets be very clear on these.
  • Loading branch information
hazendaz authored Nov 7, 2023
1 parent b5a9e57 commit fb42887
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package com.github.spotbugs.snom

import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.IgnoreIf

import java.nio.file.Files

Expand Down Expand Up @@ -118,6 +119,7 @@ class CacheabilityFunctionalTest extends BaseFunctionalTest {
/**
* @see <a href="https://github.com/spotbugs/spotbugs-gradle-plugin/issues/914">GitHub Issues</a>
*/
@IgnoreIf({ !jvm.java11 })
def 'spotbugsMain is cacheable even if a stylesheet is set as String for the HTML report'() {
given:
def buildFile = new File(rootDir, "build.gradle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.github.spotbugs.snom

import org.gradle.testkit.runner.BuildResult
import spock.lang.IgnoreIf

import static org.gradle.testkit.runner.TaskOutcome.SUCCESS

Expand Down Expand Up @@ -205,6 +206,7 @@ spotbugs {
result.getOutput().contains("-high")
}

@IgnoreIf({ !jvm.java11 })
def "can use toolVersion to set the SpotBugs version"() {
setup:
buildFile << """
Expand All @@ -221,6 +223,7 @@ spotbugs {
result.output.contains("SpotBugs 4.0.0-beta4") || result.output.contains("spotbugs-4.0.0-beta4.jar")
}

@IgnoreIf({ !jvm.java11 })
def "can use toolVersion to get the SpotBugs version"() {
setup:
buildFile << """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.github.spotbugs.snom

import org.gradle.testkit.runner.BuildResult
import spock.lang.IgnoreIf

import static org.gradle.testkit.runner.TaskOutcome.SUCCESS

Expand Down Expand Up @@ -99,6 +100,7 @@ dependencies {
!result.output.contains("Trying to add already registered factory")
}

@IgnoreIf({ !jvm.java11 })
def "can use the specified SpotBugs version"() {
setup:
buildFile << """
Expand Down Expand Up @@ -136,6 +138,7 @@ tasks.spotbugsMain {
report.isFile()
}

@IgnoreIf({ !jvm.java11 })
def "can use toolVersion to get the SpotBugs version"() {
setup:
buildFile << """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package com.github.spotbugs.snom
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Ignore
import spock.lang.IgnoreIf

import static org.gradle.testkit.runner.TaskOutcome.SUCCESS

Expand Down Expand Up @@ -105,6 +106,7 @@ subprojects {
result.output.contains("spotbugs-4.0.0-RC1.jar")
}

@IgnoreIf({ !jvm.java11 })
def "can use toolVersion in the subproject"() {
setup:
subBuildFile << """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package com.github.spotbugs.snom

import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.IgnoreIf
import spock.lang.Unroll

import java.nio.file.Paths
Expand Down Expand Up @@ -73,6 +74,7 @@ public class Foo {
result.output.contains("spotbugsTest - Run SpotBugs analysis for the source set 'test'")
}

@IgnoreIf({ !jvm.java11 })
def "can use the specified SpotBugs version"() {
setup:
buildFile << """
Expand Down

0 comments on commit fb42887

Please sign in to comment.