Add @RestrictToGradleVersionsEqualTo annotation for filtering test matrix#337
Open
FinlayRJW wants to merge 31 commits into
Open
Add @RestrictToGradleVersionsEqualTo annotation for filtering test matrix#337FinlayRJW wants to merge 31 commits into
@RestrictToGradleVersionsEqualTo annotation for filtering test matrix#337FinlayRJW wants to merge 31 commits into
Conversation
kelvinou01
reviewed
Jan 7, 2026
|
|
||
| #### Filtering to Specific Versions | ||
|
|
||
| Use `@WithOnlyGradleVersions` to filter the test matrix to only run on specific Gradle versions. Unlike `@WithGradleVersions` which adds versions, this annotation restricts which versions from the matrix will actually run. |
Contributor
There was a problem hiding this comment.
The name @WithOnlyGradleVersions could imply an authoritative list of versions you run the test with. This can be confusing.
Contributor
Author
There was a problem hiding this comment.
what about RestrictToGradleVersionsEqualTo I think that implies it only filters?
Contributor
Author
There was a problem hiding this comment.
then we can add RestrictToGradleVersionsGreaterThan etc later
@WithOnlyGradleVersions annotation for filtering test matrix@RestrictToGradleVersions annotation for filtering test matrix
@RestrictToGradleVersions annotation for filtering test matrix@RestrictToGradleVersionsEqualTo annotation for filtering test matrix
Generate changelog in
|
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview💡 Improvements
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR
When using
@RestrictToGradleVersionsEqualTo, you can only add versions to the test matrix. There's no way to restrict a specific test to run against only certain versions from the matrix. If you need to run a test against just one Gradle version (e.g., for version-specific behavior testing), you had to run it againstall configured versions.
After this PR
Introduces
@RestrictToGradleVersionsEqualToannotation that filters the test matrix to only include specified versions:@RestrictToGradleVersionsEqualToto first add a version then filter to only that version:@WithSpecialCaseGradleVersionsCondition("8.5")@RestrictToGradleVersionsEqualTo("8.5")==COMMIT_MSG==
Add
@RestrictToGradleVersionsEqualToannotation==COMMIT_MSG==
Possible downsides?
@RestrictToGradleVersionsEqualTothat isn't in the matrix, the test silently doesn't run (by design, but could be surprising)