-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add extra tests for zero major version #472
Conversation
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 <[email protected]>
Codecov ReportAll modified lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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) |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…rk#472) Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.35.1 to 1.36.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](onsi/gomega@v1.35.1...v1.36.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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