A suite of tests for applications using AOT on the JVM and in GraalVM native images. There are two types of tests: unit tests and application tests.
Unit tests are processed ahead of time and are then either run on the JVM or as a native executable.
Unit tests can be run on the JVM using the test
task and as a native executable using the nativeTest
task.
Application tests are always executed on the JVM against an application that’s running on the JVM or as a native executable.
The appTest
task tests the application running on the JVM.The nativeAppTest
task tests the application running as a native executable.
Please read and follow the contributing guide.
./gradlew :<name of the group>:<name of the smoke test>:build
for example
./gradlew :boot:actuator-webmvc:build
./gradlew :<name of the group>:<name of the smoke test>:<test task name>
Valid test task names are:
-
appTest
– tests the application running on the JVM -
nativeAppTest
– tests the application running as a native executable -
test
– executes the AOT-processed unit tests on the JVM -
nativeTest
– executes the AOT-processed unit tests in a native executable
for example
./gradlew :boot:actuator-webmvc:appTest
-
Create a new directory for your smoke test in the appropriate group
-
Include the directory in
settings.gradle
-
Run
./gradlew updateInfrastructure
to add the smoke test to the status page and CI pipeline
./gradlew :<name of the group>:<name of the smoke test>:build --include-build /path/to/your/project
Gradle will then substitute the dependency with your provided version.
Hint: You can use --include-build
multiple times.
First, install the snapshots into your local Maven cache.
You can now consume those snapshots using -PfromMavenLocal
which takes a comma-separated list of group IDs:
./gradlew :rest-template:build -PfromMavenLocal=org.springframework,org.springframework.data
The preceding example will run the rest-template
smoke test, resolving Spring Framework and Spring Data modules from your local Maven cache.
As the test doesn’t use the Spring Dependency Management Plugin, you can’t use the ext['…'] = '…'
method.
Instead, use Gradle dependency constraints.
Say, for example, you want to update the version of Spring Session JDBC to 3.0.0-SNAPSHOT
:
dependencies {
// ...
constraints {
implementation('org.springframework.session:spring-session-jdbc:3.0.0-SNAPSHOT')
}
}
This works for direct and transitive dependencies.