NBT allows to invoke an existing test suite in a native image. For that to work, we need to process each test context ahead-of-time and make sure that the optimized version is available in the classpath that NBT uses.
The underlying feature is being implemented in the core framework. See https://github.com/spring-projects/spring-framework/issues/28825 which should provide a main class to invoke similar to our AotProcessor.
Things to consider:
- Create a test mojo in the Maven Plugin that invokes the main class as part of the
process-test-classesphase. As part of this work, some of the code in the existingAotGenerateMojocan be refactored to be reused (typically the bits that do the compilation and copying). - Create a new Gradle task that invokes the main class
- Update the
nativemaven profile to include a call to the new mojo. This is worth a discussion as the testing with native bit could be totally opt-in. Perhaps it could be added but skipped by default with a way to enable it using a property?
Naming wise, we started a discussion in #31918.
Sub Tasks:
- [x] #32191
- [x] #32192
- [x] #32383
- [x] #31965
Comment From: sbrannen
For an overview of the current status of native testing support in the TestContext framework, see:
- https://github.com/spring-projects/spring-framework/issues/29029
Comment From: philwebb
Closing this one as superseded since all the sub-tasks have now been closed.