Skip to content

make it easier to run graal native tests #13551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/scripts/native-tests.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 2 additions & 12 deletions .github/workflows/reusable-native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -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')}}"

Loading