Skip to content

Commit 3bef401

Browse files
dnestorofniephaus
authored andcommitted
Prevent
1 parent 7a7f266 commit 3bef401

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

tests/tck-build-logic/src/main/groovy/org.graalvm.internal.tck-harness.gradle

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Provider<Task> diff = tasks.register("diff", DefaultTask) { task ->
7474
}
7575

7676
List<String> diffCoordinates = new ArrayList<>()
77+
boolean testAll = false
7778
if (project.hasProperty("baseCommit")) {
7879
String baseCommit = project.findProperty("baseCommit")
7980
String newCommit = Objects.requireNonNullElse(project.findProperty("newCommit"), "HEAD")
@@ -87,6 +88,8 @@ if (project.hasProperty("baseCommit")) {
8788
dependsOn(taskTaskName)
8889
}
8990
}
91+
92+
testAll = tck.shouldTestAll()
9093
}
9194

9295
def matrixDefault = [
@@ -136,13 +139,22 @@ Provider<Task> generateMatrixDiffCoordinates = tasks.register("generateMatrixDif
136139
]
137140

138141
matrix.putAll(matrixDefault)
142+
139143
/**
140-
* when we are introducing a new metadata, we should test it against all versions,
141-
* not just the oldest and the newest one (which we are testing by default)
144+
* if we changed some files from tck-build-logic or github workflows, we must run all tests
145+
* to check if we accidentally broke something. In this case, we will have a lots of tests, so we can't
146+
* run them with all possible JDK versions, because we will hit the following error:
147+
* Strategy expansion exceeded 256 results for job 'test-changed-metadata'
142148
*/
143-
matrix.version.add("21")
144-
matrix.version.add("22")
145-
matrix.version.add("dev")
149+
if (!testAll) {
150+
/**
151+
* when we are introducing a new metadata, we should test it against all versions,
152+
* not just the oldest and the newest one (which we are testing by default)
153+
*/
154+
matrix.version.add("21")
155+
matrix.version.add("22")
156+
matrix.version.add("dev")
157+
}
146158
println "::set-output name=matrix::${JsonOutput.toJson(matrix)}"
147159
println "::set-output name=none-found::false"
148160
}

tests/tck-build-logic/src/main/groovy/org/graalvm/internal/tck/harness/TckExtension.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ Path getTestDir(String coordinates) {
119119
throw new RuntimeException("Missing test-directory for coordinates `" + coordinates + "`");
120120
}
121121

122+
private boolean shouldTestAll = false;
123+
124+
public boolean shouldTestAll() {
125+
return shouldTestAll;
126+
}
127+
122128
/**
123129
* Returns a list of coordinates that match changed files between baseCommit and newCommit.
124130
*
@@ -154,6 +160,7 @@ List<String> diffCoordinates(String baseCommit, String newCommit) {
154160
}));
155161

156162
if (testAll.get()) {
163+
shouldTestAll = true;
157164
// If tck was changed we should retest everything, just to be safe.
158165
return getMatchingCoordinates("");
159166
}

0 commit comments

Comments
 (0)