-
Notifications
You must be signed in to change notification settings - Fork 353
Allow to not invoke the test aot task with Gradle #1338
Comments
But isn't disabling AOT is as simple as setting VM option |
Hello, I tried with:
or using The classpath for unit tests and the system properties are still modified by the plugin. |
AOT mode for tests is useful for both JVM and native since it allows to ensure that the AOT flavor run fines on JVM (fast feedback loop) before going on native side (slower). I think for now, AOT generation for test happen unconditionally (IMO not a major issue) and execution of tests in AOT mode (JVM or native) happen if generated test files are detected. I don't think we support For disabling native tests, Gradle Native Build Tools plugin allow to disable native tests via:
Maven Native Build Tools plugin allow to disable native test by removing the |
Thanks @sdeleuze for this feedback 👍 In the meantime, if someone else is interested by having a workaround, I did this for now in a
|
For the record, this is only a problem with Gradle as far as I can see as Maven has two separate goals and you could decide to include them or not. If I understood correctly, generateTestAot is invoked with no way to disable it with Gradle? I wouldn't put pressure on fixing this but that looks a little odd to me. IMO, this is also a different issue than having the plugin configured and choosing to run the tests without AOT. |
I am not sure I agree since with Maven |
Yes but that's not the same problem. I understand there is no easy way to not invoke the test aot task with Gradle. IMO it is a more severe limitation than what you've described. |
It is the way it is right now because we initially decided to make it the default. |
I renamed this issue to clarify it is about allowing to not invoke the test aot task with Gradle, and created #1356 about providing a way to use regular codepath for test execution. |
For us, disabling AOT in Gradle for tests would also be beneficial. |
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
Dear team,
I was thinking that I could be interesting to have an easy way to disable AOT for unit tests.
Indeed, for example, I'm currently building a Spring cloud function and I haveimplemented unit tests as indicated in Spring Cloud Function docs.
I will package this function with Native, but I don't want to tackle the native part for unit tests, the classic unit tests are fine.
In the gradle plugin, this section enables the aotTest for all tasks of type
Test
. Wouldn't it be good to do that section for GraalVMnativeTest
task only ?Also,
aotMain
seems to be run only fornativeCompile
task so I think it would make sense to do the same for test.What do you think ?
The text was updated successfully, but these errors were encountered: