Skip to content

Commit

Permalink
Avoid conditionally running tests based on GraalVM patch version
Browse files Browse the repository at this point in the history
Relates to quarkusio#45873
  • Loading branch information
zakkak committed Jan 27, 2025
1 parent b4287d5 commit adbbce8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ public static final class Version extends io.quarkus.runtime.graal.GraalVM.Versi
static final Version VERSION_21_3_0 = new Version("GraalVM 21.3.0", "21.3.0", Distribution.GRAALVM);
public static final Version VERSION_23_0_0 = new Version("GraalVM 23.0.0", "23.0.0", "17", Distribution.GRAALVM);
public static final Version VERSION_23_1_0 = new Version("GraalVM 23.1.0", "23.1.0", "21", Distribution.GRAALVM);
public static final Version VERSION_23_1_2 = new Version("GraalVM 23.1.2", "23.1.2", "21", Distribution.GRAALVM);
public static final Version VERSION_23_1_3 = new Version("GraalVM 23.1.3", "23.1.3", "21", Distribution.GRAALVM);
public static final Version VERSION_24_0_0 = new Version("GraalVM 24.0.0", "24.0.0", "22", Distribution.GRAALVM);
public static final Version VERSION_24_0_999 = new Version("GraalVM 24.0.999", "24.0.999", "22", Distribution.GRAALVM);
public static final Version VERSION_24_1_0 = new Version("GraalVM 24.1.0", "24.1.0", "23", Distribution.GRAALVM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.DisableIfBuiltWithGraalVMNewerThan;
import io.quarkus.test.junit.DisableIfBuiltWithGraalVMOlderThan;
import io.quarkus.test.junit.GraalVMVersion;
import io.quarkus.test.junit.QuarkusIntegrationTest;
Expand Down Expand Up @@ -58,16 +57,10 @@ public void testTargetWithoutNested() {
assertRegistration("FAILED", resourceD + "$StaticClassOfD$OtherAccessibleClassOfD");
}

// NOTE: This test is expected to fail with GraalVM >= 23.1.0 and < 23.1.3 yet we enable it for all 23.1 versions
// due to https://github.com/quarkusio/quarkus/issues/45873
@Test
@DisableIfBuiltWithGraalVMNewerThan(GraalVMVersion.GRAALVM_23_1_2)
public void testLambdaCapturingPre23_1_3() {
// Starting with GraalVM 22.1 support Lambda functions serialization
// (see https://github.com/oracle/graal/issues/3756)
RestAssured.given().when().get("/reflection/lambda").then().body(startsWith("Comparator$$Lambda$"));
}

@Test
@DisableIfBuiltWithGraalVMOlderThan(GraalVMVersion.GRAALVM_23_1_3)
@DisableIfBuiltWithGraalVMOlderThan(GraalVMVersion.GRAALVM_23_1_0)
public void testLambdaCapturingPost23_1_2() {
// Starting with GraalVM 23.1.3 lambda class names match the ones from HotSpot
// (see https://github.com/oracle/graal/pull/7775 and https://github.com/oracle/graal/commit/7d158e5c141e2f5c84f27095d8718189ab4953c2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import io.quarkus.deployment.pkg.steps.GraalVM;

public enum GraalVMVersion {
GRAALVM_23_1_2(GraalVM.Version.VERSION_23_1_2),
GRAALVM_23_1_3(GraalVM.Version.VERSION_23_1_3),
GRAALVM_23_1_0(GraalVM.Version.VERSION_23_1_0),
GRAALVM_24_0_0(GraalVM.Version.VERSION_24_0_0),
GRAALVM_24_0_999(GraalVM.Version.VERSION_24_0_999),
GRAALVM_24_1_0(GraalVM.Version.VERSION_24_1_0),
Expand Down

0 comments on commit adbbce8

Please sign in to comment.