internal/testrunner/script: add breaking change conditionals#3263
Merged
efd6 merged 6 commits intoelastic:mainfrom Feb 13, 2026
Merged
internal/testrunner/script: add breaking change conditionals#3263efd6 merged 6 commits intoelastic:mainfrom
efd6 merged 6 commits intoelastic:mainfrom
Conversation
This allows skipping test or running conditional commands based on whether the tested version is a breaking change. Breaking change status is determined by whether the type of the change in the changelog.yml is "breaking-change" or the major version of the current version is different to the major version of the previous version in the changelog.yml.
…T_EPR_VERSION env var This allows skipping tests for back-ports.
This is another condition to allow upgrade testing.
jsoriano
reviewed
Feb 11, 2026
Collaborator
💚 Build Succeeded
History
cc @efd6 |
jsoriano
approved these changes
Feb 12, 2026
Member
jsoriano
left a comment
There was a problem hiding this comment.
Looks good thanks, added a couple of small suggestions.
internal/testrunner/script/script.go
Outdated
| if err != nil { | ||
| return err | ||
| } | ||
| eprClient := registry.NewClient(appConfig.PackageRegistryBaseURL()) |
Member
There was a problem hiding this comment.
Nit. A new client is created for each directory in dirs, though it could be reused.
internal/testrunner/script/script.go
Outdated
Comment on lines
+206
to
+220
| eprClient := registry.NewClient(appConfig.PackageRegistryBaseURL()) | ||
| revisions, err := eprClient.Revisions(manifest.Name, registry.SearchOptions{}) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| if len(revisions) > 0 { | ||
| latestEPRVersion = revisions[len(revisions)-1].Version | ||
| latestSemver, err := semver.NewVersion(latestEPRVersion) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to parse latest epr version: %w", err) | ||
| } | ||
| if latestSemver.GreaterThanEqual(currSemver) { | ||
| isLatestVersion = false | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Nit. Consider moving this logic to its own function.
Suggested change
| eprClient := registry.NewClient(appConfig.PackageRegistryBaseURL()) | |
| revisions, err := eprClient.Revisions(manifest.Name, registry.SearchOptions{}) | |
| if err != nil { | |
| return err | |
| } | |
| if len(revisions) > 0 { | |
| latestEPRVersion = revisions[len(revisions)-1].Version | |
| latestSemver, err := semver.NewVersion(latestEPRVersion) | |
| if err != nil { | |
| return fmt.Errorf("failed to parse latest epr version: %w", err) | |
| } | |
| if latestSemver.GreaterThanEqual(currSemver) { | |
| isLatestVersion = false | |
| } | |
| } | |
| latestEPRVersion, isLatestVersion, err := getLatestEPRVersion(eprClient, manifest.Name) | |
| if err != nil { | |
| return err | |
| } |
Contributor
Author
There was a problem hiding this comment.
I've hoisted the manifest reading and revision checks out as for the client, but I'm not sure the indirection is something that improves clarity.
jsoriano
approved these changes
Feb 13, 2026
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.
These two commits add conditionals that can be used to allow skipping tests or running commands based on whether the change is a breaking change or is a back port. This improves the robustness of testing for situations like upgrade testing.
There is testing for the breaking change conditional, but not for the "is latest version" conditional since it depends on EPR and the name of the package being in the EPR, the first of which is not a stable workbench to test on and the latter of which is not possible because the tests here don't end up in the EPR.
Please take a look.