Add extra tests for zero major version#472
Merged
m1kola merged 1 commit intooperator-framework:mainfrom Oct 19, 2023
Merged
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 <mradchuk@redhat.com>
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. |
m1kola
commented
Oct 19, 2023
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) |
Member
Author
There was a problem hiding this comment.
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)
4 tasks
LalatenduMohanty
pushed a commit
to LalatenduMohanty/operator-controller
that referenced
this pull request
Dec 19, 2024
…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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
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