Skip to content
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

Provide built-in support for GraalVM native images #3040

Open
5 tasks
sbrannen opened this issue Sep 20, 2022 · 1 comment
Open
5 tasks

Provide built-in support for GraalVM native images #3040

sbrannen opened this issue Sep 20, 2022 · 1 comment

Comments

@sbrannen
Copy link
Member

sbrannen commented Sep 20, 2022

Overview

The GraalVM Native Build Tools (NBT) project provides support for running tests within a native image using the JUnit Platform. Since JUnit 5 has never provided built-in support for running in a native image, the NBT team implemented an internal PluginConfigProvider mechanism for contributing native image configuration for the JUnit Platform, JUnit Jupiter, and JUnit Vintage projects.

The JUnitPlatformFeature also registers reflection for all test classes.

Rationale

The code in the above classes is very specific to JUnit 5 and can therefore be better maintained by the JUnit team. In addition, having the native image configuration directly in JUnit 5 artifacts will allow the JUnit team to proactively integration test support for GraalVM native images, thereby avoiding issues such as #3035.

Deliverables

  • Add a new section on GraalVM native image support in the User Guide -- for example, in the "Running Tests" section.
  • Introduce integration tests that run on the CI server which verify support for GraalVM native images without using Native Build Tools (as a companion to recently introduced integration tests that use NBT) -- for example, using the ConsoleLauncher as the application class for the compiled native image.
  • Avoid build-time initialization in JUnit 5 wherever feasible and list the remaining classes in native-image.properties of each jar
  • Determine how much of the functionality in the PluginConfigProvider implementations in NBT can be migrated to JUnit 5.
  • Determine how much of the functionality in the JUnitPlatformFeature and its support classes can be migrated to JUnit 5.
@wilkinsona
Copy link

+1 for this. The breaking change in 5.10 that requires --initialize-at-build-time for two classes would be avoided if appropriate native-image.properties files were were included in the relevant jars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants