Skip to content

Fix custom native test classpath wiring#925

Draft
jormundur00 wants to merge 1 commit into
graalvm:masterfrom
jormundur00:rhei-fixloop2/issue-702
Draft

Fix custom native test classpath wiring#925
jormundur00 wants to merge 1 commit into
graalvm:masterfrom
jormundur00:rhei-fixloop2/issue-702

Conversation

@jormundur00

Copy link
Copy Markdown
Member

Fixes #702

Spec fit

Issue 702 is compatible with the Gradle native-test contract: a custom native test binary registered
with registerTestBinary should derive classes, resources, runtime classpath, test identifiers, and
JUnit native support from the configured source set and Test task. This PR adds the explicit
custom-test spec point for that behavior and cites it from the Gradle plugin implementation and
functional regression coverage.

Implementation summary

  • Adds FS-gradle-native-tests.1.1 for custom native test binaries.
  • Changes native test configuration creation to use the selected source set runtime classpath
    configuration instead of always using the default testRuntimeClasspath.
  • Adds a functional regression test that checks nativeImageIntegTestClasspath includes the custom
    source set project/JUnit dependencies and plugin-provided junit-platform-native.
  • Updates the custom-test sample so it no longer inherits dependencies from the default test
    configurations, avoiding the masking behavior from the original bug.

Validation evidence

  • JAVA_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal ./gradlew :native-gradle-plugin:functionalTest --tests "org.graalvm.buildtools.gradle.JavaApplicationWithTestsFunctionalTest.custom test image classpath follows custom source set"
  • JAVA_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal ./gradlew :native-gradle-plugin:functionalTest --tests "org.graalvm.buildtools.gradle.JavaApplicationWithTestsFunctionalTest.can register a custom test image"
  • JAVA_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal ./gradlew :native-gradle-plugin:test :native-gradle-plugin:inspections
  • JAVA_HOME=/home/jovan/.sdkman/candidates/java/17.0.12-graal ./gradlew :native-gradle-plugin:configCacheFunctionalTest --tests "org.graalvm.buildtools.gradle.JavaApplicationWithTestsFunctionalTest.custom test image classpath follows custom source set"
  • git diff --check
  • grund gradle/FS-gradle-native-tests.1.1 --brief

grund check was also run and failed only on pre-existing outdated grund init blocks in repository
AGENTS.md files. The new spec section resolves directly. Full Gradle functional matrices, full
repository build, and an issue-specific native-image compile/runtime execution were not run locally.

Review readiness

Local aggregate review found no requirements, spec/grund, implementation, or blocking validation
findings. Ready to publish: yes.

Remaining human follow-up

  • Review the focused validation scope and decide whether to run broader CI or native-image runtime
    coverage before marking the PR ready.
  • Resolve the pre-existing outdated grund init blocks separately if a clean full grund check is
    required for repository maintenance.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 15, 2026
@jormundur00 jormundur00 force-pushed the rhei-fixloop2/issue-702 branch from ec7ae54 to 412ae65 Compare June 18, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement. rhei

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect classpath when configuring additional test suites

1 participant