Skip to content
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

Improve istioversion and e2e test #686

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fjglira
Copy link
Contributor

@fjglira fjglira commented Feb 28, 2025

What type of PR is this?

  • Enhancement / New Feature
  • Bug Fix
  • Refactor
  • Optimization
  • Test
  • Documentation Update

What this PR does / why we need it:

This PR adds a new function to get all the patch versions from each Major.Minor version in the versions.yaml to be used later by the e2e test to iterate over only the latest patch version on each Minor.

  • GetLatestPatchVersions returns the last patch version for each Minor
  • GetPatchVersionsByMajorMinor returns all the patch versions for every Minor version. This is needed to ensure that the update tests are over the same Major.Minor version
  • In the control plane update test I added getBaseAndNewVersion() in favor of getting old and new version directly from istioversion.Old and istioversion.New because this two does not ensure that are different minor versions, and the update test can fail when is upgrade of minor versions (because of changes between
  • istio minor version)

This will decrease the execution time of the e2e framework because before we where executing a lot of test for all the versions inside the versions.yaml file, now, we are only going to run the scenario for the latest patch for each Minor version

Which issue(s) this PR fixes:

Fixes #681

Related Issue/PR #

Additional information:

@fjglira fjglira requested a review from a team as a code owner February 28, 2025 16:12
@fjglira
Copy link
Contributor Author

fjglira commented Feb 28, 2025

/test lint

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 91.11111% with 4 lines in your changes missing coverage. Please review.

Project coverage is 74.40%. Comparing base (fae4c9f) to head (bee5835).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/istioversion/version.go 91.11% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #686      +/-   ##
==========================================
+ Coverage   74.31%   74.40%   +0.08%     
==========================================
  Files          43       43              
  Lines        2597     2637      +40     
==========================================
+ Hits         1930     1962      +32     
- Misses        574      579       +5     
- Partials       93       96       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


// getBaseAndNewVersion returns the base and new Istio versions to be used in the tests.
// It will take the latest Major.Minor version and get the two newest patch of that Major.Minor version.
func getBaseAndNewVersion() (string, string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this new logic? Can't we just use .Old and .New like before?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and if we replace .Old and .New, we should remove them and put this func (or a similar one) in the istioversion package 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because .Old and.New can be different minor versions. Do we want to test also upgrades between versions? I mean, things can be different between minor versions

@fjglira
Copy link
Contributor Author

fjglira commented Feb 28, 2025

/test lint


// getBaseAndNewVersion returns the base and new Istio versions to be used in the tests.
// It will take the latest Major.Minor version and get the two newest patch of that Major.Minor version.
func getBaseAndNewVersion() (string, string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be in version.go?

continue
}

newVer, err1 := semver.NewVersion(group[0].Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

.Name is the version name, not the semantic version number. You should probably use .Version here.

fjglira and others added 2 commits March 3, 2025 11:52
Signed-off-by: Francisco H <frherrer@redhat.com>
Co-authored-by: Marko Lukša <mluksa@redhat.com>
Signed-off-by: Francisco H <frherrer@redhat.com>
Signed-off-by: Francisco H <frherrer@redhat.com>
Signed-off-by: Francisco H <frherrer@redhat.com>
Signed-off-by: Francisco H <frherrer@redhat.com>
@fjglira fjglira requested review from luksa and dgn March 3, 2025 17:12
@fjglira
Copy link
Contributor Author

fjglira commented Mar 3, 2025

Fixes #645. This issue was related to not running against all the versions in the versions.yaml file

@fjglira fjglira linked an issue Mar 4, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants