Skip to content

Commit 18b0240

Browse files
committed
improve gradle test version handling
1 parent d6dfb30 commit 18b0240

File tree

5 files changed

+33
-16
lines changed

5 files changed

+33
-16
lines changed

src/testInt/groovy/io/openapiprocessor/gradle/GroovyDslSpec.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ class GroovyDslSpec extends PluginSpec {
5757
result.output.contains("processor v1 did run !")
5858
5959
where:
60-
gradleVersion << Gradle.VERSIONS_7.reverse ()
60+
gradleVersion << Gradle.VERSIONS_7
61+
.findAll { it.groovy }
62+
.collect { it.version }
6163
}
6264
6365
@Unroll

src/testInt/groovy/io/openapiprocessor/gradle/KotlinDslSpec.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package io.openapiprocessor.gradle
77

88
import io.openapiprocessor.gradle.support.Gradle
99
import io.openapiprocessor.gradle.support.PluginSpec
10+
import spock.lang.Ignore
1011
import spock.lang.Unroll
1112

1213
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
@@ -47,6 +48,7 @@ class KotlinDslSpec extends PluginSpec {
4748
['--stacktrace', 'processV1']
4849
}
4950

51+
@Ignore("does not run since gradle 9.2.1")
5052
@Unroll
5153
void "test kotlin dsl with with gradle 7 (#gradleVersion)" () {
5254
when:
@@ -57,7 +59,9 @@ class KotlinDslSpec extends PluginSpec {
5759
result.output.contains("processor v1 did run !")
5860
5961
where:
60-
gradleVersion << Gradle.VERSIONS_7.reverse ()
62+
gradleVersion << Gradle.VERSIONS_7
63+
.findAll { it.kotlin }
64+
.collect { it.version }
6165
}
6266
6367
@Unroll

src/testInt/groovy/io/openapiprocessor/gradle/MultipleConfigurationsDifferentProcessorsSpec.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ class MultipleConfigurationsDifferentProcessorsSpec extends PluginSpec {
7171
assertResult (result)
7272
7373
where:
74-
gradleVersion << Gradle.VERSIONS_7.reverse ()
74+
gradleVersion << Gradle.VERSIONS_7
75+
.findAll { it.groovy }
76+
.collect { it.version }
7577
}
7678
7779
@Unroll

src/testInt/groovy/io/openapiprocessor/gradle/MultipleConfigurationsSameProcessorSpec.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ class MultipleConfigurationsSameProcessorSpec extends PluginSpec {
6666
assertResult (result)
6767
6868
where:
69-
gradleVersion << Gradle.VERSIONS_7.reverse ()
69+
gradleVersion << Gradle.VERSIONS_7
70+
.findAll { it.groovy }
71+
.collect { it.version }
7072
}
7173
7274
@Unroll

src/testInt/groovy/io/openapiprocessor/gradle/support/Gradle.groovy

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
package io.openapiprocessor.gradle.support
77

88
class Gradle {
9+
static class Version {
10+
String version
11+
boolean groovy
12+
boolean kotlin
13+
}
14+
15+
static private Version version(String version, boolean runsWithGroovy, boolean runsWithKotlin) {
16+
return new Version(version: version, groovy: runsWithGroovy, kotlin: runsWithKotlin)
17+
}
918

1019
static List<String> VERSIONS_9 = [
1120
'9.0.0',
@@ -31,17 +40,15 @@ class Gradle {
3140
/* '8.14', '8.14.1', '8.14.2' */ '8.14.3'
3241
]
3342

34-
static List<String> VERSIONS_7 = [
35-
'7.2',
36-
/* '7.3', '7.3.1', '7.3.2', */ '7.3.3',
37-
/* '7.4', '7.4.1', */ '7.4.2',
38-
/* '7.5', */ '7.5.1',
39-
/* '7.6', '7.6.1', '7.6.2', '7.6.3', '7.6.4', '7.6.5' */ '7.6.6'
40-
]
41-
42-
// these only work with java 11
43-
static List<String> VERSIONS_7_JDK11 = [
44-
/* '7.0', '7.0.1', */ '7.0.2',
45-
/* '7.1', */ '7.1.1'
43+
static List<Version> VERSIONS_7 = [
44+
// don't run since 9.2.1 with kotlin
45+
version('7.6.6', true, false),
46+
version('7.5.1', true, false),
47+
version('7.4.2', true, false),
48+
version('7.3.3', true, false),
49+
version('7.2', true, false),
50+
// jdk 11 only
51+
version('7.1.1', false, false),
52+
version('7.0.2', false, false)
4653
]
4754
}

0 commit comments

Comments
 (0)