Skip to content

Add spring aot smoke testing workflows#971

Merged
jormundur00 merged 6 commits intomasterfrom
jormundur00/gh-710
Feb 11, 2026
Merged

Add spring aot smoke testing workflows#971
jormundur00 merged 6 commits intomasterfrom
jormundur00/gh-710

Conversation

@jormundur00
Copy link
Copy Markdown
Member

@jormundur00 jormundur00 commented Jan 27, 2026

What does this PR do?

In this PR we introduce workflows for automated testing of all PR-affected Spring AOT smoke tests. We add 3 separate workflows for 3.4.x, 3.5.x and main (4.0.x) branches of the smoke test repository. Whenever a committer changes an existing libraries metadata on a pull request, the workflows will run all existing smoke tests that have that library as a dependency.

This is done in the following way (same process for each branch):

  1. Firstly, on pull request, the workflow computes "affected" spring tests by fetching the smoke tests repository and injecting the spring-aot-impact-scan.gradle gradle task into that repository. The task is then ran on the specific branch denoted by the workflow, and all tests that use either nativeTest or nativeTestCompile and have a transitive dependency on changed-metadata-libraries are output to the workflow (through the generateAffectedSpringTestMatrix task).
  2. All the collected tests are then ran, one job per test. If a test fails, the workflow checks if the test has a expectedToFail flag set in its build.gradle, or if the last run of the test fails on the smoke test repositories CI. If that is the case, the job will be reported as successful (due to the issue with it being outside of reachability-metadata's control), otherwise, the job fails (meaning committers can't break existing tests with metadata changes).
  3. The results of all test runs are processed and if any test jobs failed, the workflow run fails and PR merging is blocked.

All tests run on specific graalvm versions based on their branch (GraalVM17 for 3.4.x/3.5.x and GraalVM25 for 4.0.x by default), and this version mapping is specified in ci.json. The java version used can be overridden in a specific tests build.gradle (by specifying javaVersion), and this is also taken into consideration by the workflows.

The reasons we have a separate workflow for each branch, as opposed to one workflow for all branches are that: all branches use different configurations (so batching the same test, if it exists, on multiple branches in one job would be very difficult as the tests would differ and use different configurations) and to bypass the GitHub actions CI job limit (that would be easily reached in a one-workflow scenario). Multiple workflows also allow for easy removal or addition of a branch that we want to test.

An example of the workflows running for a PR that changes metadata for a library used by all tests can be found here:
jormundur00#81

Fixes: #710

@jormundur00 jormundur00 self-assigned this Jan 27, 2026
@jormundur00 jormundur00 added the enhancement New feature or request label Jan 27, 2026
@mhalbritter
Copy link
Copy Markdown
Collaborator

So, we've added a 4.0.x branch (which tests against Spring Boot 4.0.x) and moved the main branch to test against Spring Boot 4.1.x. These tests did run yesterday for the first time.

@jormundur00
Copy link
Copy Markdown
Member Author

So, we've added a 4.0.x branch (which tests against Spring Boot 4.0.x) and moved the main branch to test against Spring Boot 4.1.x. These tests did run yesterday for the first time.

I've added a workflow for 4.0.x and moved the main workflow to 4.1.x. I ran all the tests on the fork example where we change metadata in a PR, and the tests completed normally.

Copy link
Copy Markdown
Collaborator

@mhalbritter mhalbritter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've looked at the PR and found some things. Besides that looks good.

docs/CI.md Outdated
- Triggers: PRs to master touching [tests/tck-build-logic/](tests/tck-build-logic/), [gradle/](gradle/), [build.gradle](../build.gradle), [settings.gradle](../settings.gradle), or [gradle.properties](../gradle.properties).
- Uses: generateInfrastructureChangedCoordinatesMatrix. Pulls allowed images, disables Docker networking, validates config, then runs tests.
- Test affected Spring AOT smoke tests ([.github/workflows/test-affected-spring-aot-3.5.x.yml](../.github/workflows/test-affected-spring-aot-3.5.x.yml), [.github/workflows/test-affected-spring-aot-4.0.x.yml](../.github/workflows/test-affected-spring-aot-4.0.x.yml), [.github/workflows/test-affected-spring-aot-main.yml](../.github/workflows/test-affected-spring-aot-main.yml))
- Triggers: PRs to master touching [metadata/](metadata/) or [tests/src/](tests/src/).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we reference here just metadata/?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should, good catch. I've recently removed the tests/ check (as it makes no sense to run these when only changing tests), but forgot to remove it from the documentation.

import org.gradle.api.Project

allprojects {
tasks.register('__internalImpactScan') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation here would be very useful.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a javadoc explaining what the script does to the top of the script.

}
}

// gradle generateAffectedSpringTestMatrix -PbaseCommit=<base> -PnewCommit=<head> -PspringAotBranch=<branch> -PspringAotPath=/path/to/spring-aot-smoke-tests
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain here a bit better how this mapping is done?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a step-by-step comment on how the task generates this matrix.

@vjovanov
Copy link
Copy Markdown
Member

vjovanov commented Feb 9, 2026

Very cool!

@jormundur00 jormundur00 merged commit 97a1f28 into master Feb 11, 2026
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a github action that runs with Spring AOT Smoke Tests

4 participants