Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Provide a way to execute tests with regular code path (not AOT one) #1356

Closed
sdeleuze opened this issue Dec 7, 2021 · 0 comments
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@sdeleuze
Copy link
Contributor

sdeleuze commented Dec 7, 2021

Currently, tests are executed using the AOT code path when AOT test code has been generated. This is the default because most of the time, it brings added value to validate the AOT codepath on the JVM before going to native and allows to debug the code as it will run on native. On application side, the default is to not use AOT by default (and allow to enable AOT codepath via -DspringAot=true) in order to keep the DevXP that Spring Boot developers know and love with Devtools hot reload capabilites.

We should provide a command line option to allow to use the regular code path for test, something that would be conceptually -DspringAot=false. But unlike application, test execution is forked and run via Maven or Gradle plugins. And we need to consider how that works in IDEs too.

@sdeleuze sdeleuze added the type: enhancement A general enhancement label Dec 7, 2021
@sdeleuze sdeleuze added this to the 0.11.1 milestone Dec 7, 2021
@sdeleuze sdeleuze modified the milestones: 0.11.1, 0.11.2 Dec 17, 2021
@sdeleuze sdeleuze self-assigned this Jan 12, 2022
sdeleuze added a commit to sdeleuze/spring-native that referenced this issue Jan 19, 2022
This commit:
 - Use Spring property check instead of classpath check to enable
   or not AOT test, that's more robust and prevent an IDEA bug
   (see spring-atticgh-1395)
 - Disable Maven AOT generation and execution with mvn test -DspringAot=false
 - Introduce a Gradle aotTest task for AOT generation + execution
   in order to allow executing regular tests with the test task

TODO find why ./gradlew aotTest does not behave like ./gradlew test:
 - Flag like --debug-jvm to enable debug from command line do
   not work
 - Customization via the DSL like
   test { testLogging { showStandardStreams = true } }
   are not applied

Closes spring-atticgh-1338
Closes spring-atticgh-1356
Closes spring-atticgh-1395
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement A general enhancement
Development

No branches or pull requests

1 participant