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

Add extra tests for zero major version #472

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Oct 19, 2023

Description

Zero major version is reserved for initial development according to SemVer spec and anything may change at any time.

As the result of the above update behaviour is different for it.

This is a follow up for #444 (comment)

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Zero major version is reserved for initial development
according to SemVer spec [^1] and anything may
change at any time.

As the result of the above update behaviour is different for it.

[^1]: https://semver.org/#spec-item-4

Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 19, 2023
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (fd02095) 83.64% compared to head (9556e51) 83.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #472   +/-   ##
=======================================
  Coverage   83.64%   83.64%           
=======================================
  Files          23       23           
  Lines         862      862           
=======================================
  Hits          721      721           
  Misses         96       96           
  Partials       45       45           
Flag Coverage Δ
e2e 65.19% <ø> (ø)
unit 76.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment on lines +193 to +208
ipvs, err := variablesources.NewInstalledPackageVariableSource(&fakeCatalogClient, bundleImage)
require.NoError(t, err)

variables, err := ipvs.GetVariables(context.TODO())
require.NoError(t, err)
require.Len(t, variables, 1)
packageVariable, ok := variables[0].(*olmvariables.InstalledPackageVariable)
assert.True(t, ok)
assert.Equal(t, deppy.IdentifierFromString("installed package test-package"), packageVariable.Identifier())
variables, err := ipvs.GetVariables(context.TODO())
require.NoError(t, err)
require.Len(t, variables, 1)
packageVariable, ok := variables[0].(*olmvariables.InstalledPackageVariable)
assert.True(t, ok)
assert.Equal(t, deppy.IdentifierFromString("installed package test-package"), packageVariable.Identifier())

// ensure bundles are in version order (high to low)
bundles := packageVariable.Bundles()
require.Len(t, bundles, 3)
assert.Equal(t, "test-package.v2.2.0", packageVariable.Bundles()[0].Name)
assert.Equal(t, "test-package.v2.1.0", packageVariable.Bundles()[1].Name)
assert.Equal(t, "test-package.v2.0.0", packageVariable.Bundles()[2].Name)
// ensure bundles are in version order (high to low)
bundles := packageVariable.Bundles()
require.Len(t, bundles, 3)
assert.Equal(t, "test-package.v2.2.0", packageVariable.Bundles()[0].Name)
assert.Equal(t, "test-package.v2.1.0", packageVariable.Bundles()[1].Name)
assert.Equal(t, "test-package.v2.0.0", packageVariable.Bundles()[2].Name)
Copy link
Member Author

Choose a reason for hiding this comment

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

This piece was shifted right into a sub test. Might be easier to review this PR ignoring whitespace changes (GH has a checkbox under the cog for this or usign git diff -w)

@m1kola m1kola marked this pull request as ready for review October 19, 2023 15:03
@m1kola m1kola requested a review from a team as a code owner October 19, 2023 15:04
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 19, 2023
Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

LGTM

@m1kola m1kola added this pull request to the merge queue Oct 19, 2023
@m1kola m1kola mentioned this pull request Oct 19, 2023
4 tasks
Merged via the queue into operator-framework:main with commit 7d53835 Oct 19, 2023
12 checks passed
@m1kola m1kola deleted the semver_successors_tests branch October 19, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants