-
Notifications
You must be signed in to change notification settings - Fork 41.4k
maven-plugin aot test mojo: process aot when tests are built but not run #46890
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
maven-plugin aot test mojo: process aot when tests are built but not run #46890
Conversation
Currently, it is not possible to build the tests (with aot processing) without running them. Maven provides two different configuration switches: * skipTests builds, but does not run, tests * maven.test.skip neither builds nor runs tests Right now the spring boot aot processing will skip aot in both cases. However, there's reasons to build but not run tests: in particular, this breaks reproducible builds because the main run (with tests) has the aot classes built, but then the reproducer run (skip running tests) does not, leading to different jars. In the case where tests are built but not run, we should still do AOT processing. Signed-off-by: Steven Schlansker <[email protected]>
644f2f8
to
2e373ab
Compare
I'd argue that this would be better served by adding a new configuration option that uses the value of the That way, the code would still behave as before but a developer can control whether processing is skipped or not by overriding the default behavior.
|
I am not sure that I got that, given that the "running them" part is done by a different plugin. Please refer to the Native Maven Plugin documentation. I added this in a demo project and AOT did run, but the tests did not: <profile>
<id>nativeSkipTests</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<executions>
<execution>
<id>native-test</id>
<configuration>
<skipNativeTests>true</skipNativeTests>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile> The documentation I refered to offers a command line switch as well. Can you clarify what this PR is supposed to do? |
Thanks for the example - I think it's not the same as my use case. In your example, "normal" surefire still runs, and then native tests are skipped. In this case, we are trying to skip normal surefire as well as native tests, with |
Have you reviewed my previous comment that states our plugin does not execute the native tests? Does that PR of yours actually work? Have you tried it? Regardless, it makes no sense for us to bind to a surefire plugin-specify property, especially when our plugin doesn't do anything with test execution. The All in all, I don't think you've reviewed this thoroughly, and I can't see how the changes you've suggested is helping the scenario you've described. |
On second thought, let's continue the conversation on #46929 - This PR is nowhere near the changes we'd apply anyways. |
Currently, it is not possible to build the tests AOT processing without running them. Maven Surefire provides two different configuration switches:
skipTests
builds, but does not run, testsmaven.test.skip
neither builds nor runs testsRight now the spring boot aot processing will skip aot in both cases. However, there's reasons to build but not run tests: in particular, this breaks reproducible builds because the main run (with tests built and run) has the aot classes built, but then the reproducer run (build tests but skip running them) does not, leading to different test jars.
In the case where tests are built but not run, we should still do AOT processing, since that is part of producing the full test jar.
We'd very much appreciate a backport to 3.5.x if possible