From a74fb712e3d4cbd2c9559f11c28078821de7363d Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Wed, 19 Mar 2025 17:34:59 +0100 Subject: [PATCH] make it easier to run graal native tests --- .github/scripts/native-tests.sh | 19 +++++++++++++++++++ .github/workflows/reusable-native-tests.yml | 14 ++------------ mise.toml | 5 +++++ 3 files changed, 26 insertions(+), 12 deletions(-) create mode 100755 .github/scripts/native-tests.sh create mode 100644 mise.toml diff --git a/.github/scripts/native-tests.sh b/.github/scripts/native-tests.sh new file mode 100755 index 000000000000..fd92ce5e5b16 --- /dev/null +++ b/.github/scripts/native-tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e + +echo "GRAALVM_HOME: $GRAALVM_HOME" +echo "JAVA_HOME: $JAVA_HOME" +java --version +native-image --version +# Testcontainers does not work in some cases with GraalVM native images, +# therefore we're starting a Kafka container manually for the tests +docker compose -f .github/graal-native-docker-compose.yaml up -d +# don't wait for startup - gradle compile takes long enough + +EXTRA_ARGS="" +if [[ $TEST_LATEST_DEPS == "true" ]] +then + EXTRA_ARGS="-PtestLatestDeps=true" +fi + +./gradlew $EXTRA_ARGS nativeTest +docker compose -f .github/graal-native-docker-compose.yaml down diff --git a/.github/workflows/reusable-native-tests.yml b/.github/workflows/reusable-native-tests.yml index b9ac37c548d1..50d917aa0b5c 100644 --- a/.github/workflows/reusable-native-tests.yml +++ b/.github/workflows/reusable-native-tests.yml @@ -30,18 +30,8 @@ jobs: with: version: "latest" java-version: ${{ matrix.test-java-version }} - components: "native-image" - name: Running test env: DOCKER_COMPOSE_TEST: "true" - run: | - echo "GRAALVM_HOME: $GRAALVM_HOME" - echo "JAVA_HOME: $JAVA_HOME" - java --version - native-image --version - # Testcontainers does not work in some cases with GraalVM native images, - # therefore we're starting a Kafka container manually for the tests - docker compose -f .github/graal-native-docker-compose.yaml up -d - # don't wait for startup - gradle compile takes long enough - ./gradlew ${{ inputs.test-latest-deps && '-PtestLatestDeps=true' || '' }} nativeTest - docker compose -f .github/graal-native-docker-compose.yaml down # is this needed? + TEST_LATEST_DEPS: ${{ inputs.test-latest-deps && 'true' || 'false' }} + run: .github/scripts/native-tests.sh diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000000..c7e276480a10 --- /dev/null +++ b/mise.toml @@ -0,0 +1,5 @@ +[tasks.graalvm-native-tests] +tools.java = "graalvm-community-22.0.2" +file = ".github/scripts/native-tests.sh" +# todo figure out how to pass this env.TEST_LATEST_DEPS = "{{flag(name='latest-deps')}}" +