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

Operator update tests with semver and legacy upgrade constraints #469

Merged
merged 2 commits into from
Oct 21, 2023

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Oct 18, 2023

Adds OperatorReconciler reconcile tests for Operator upgrades. Tests include:

  • Upgrade tests with semver upgrade constraints
  • Upgrade tests with legacy OLMv0 upgrade constraints

Closes #468

Reviewer Checklist

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

@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 18, 2023
@m1kola m1kola mentioned this pull request Oct 18, 2023
4 tasks
@m1kola m1kola changed the title Upgrade tests Operator update tests with semver and legacy upgrade constraints Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (557a7fa) 83.64% compared to head (377dc9b) 83.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #469   +/-   ##
=======================================
  Coverage   83.64%   83.64%           
=======================================
  Files          23       23           
  Lines         862      862           
=======================================
  Hits          721      721           
  Misses         96       96           
  Partials       45       45           
Flag Coverage Δ
e2e 65.54% <ø> (+0.34%) ⬆️
unit 78.28% <ø> (+1.73%) ⬆️

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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 18, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 19, 2023
test/e2e/install_test.go Outdated Show resolved Hide resolved
@m1kola m1kola force-pushed the upgrade_tests branch 2 times, most recently from 639bca5 to dd5096b Compare October 19, 2023 16:09
New test data is going be easier to use with semver upgrades.

Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@@ -165,10 +170,10 @@ var _ = Describe("Operator Controller Test", func() {
Expect(bd.Spec.Template.Spec.ProvisionerClassName).To(Equal("core-rukpak-io-registry"))
Expect(bd.Spec.Template.Spec.Source.Type).To(Equal(rukpakv1alpha1.SourceTypeImage))
Expect(bd.Spec.Template.Spec.Source.Image).NotTo(BeNil())
Expect(bd.Spec.Template.Spec.Source.Image.Ref).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
Expect(bd.Spec.Template.Spec.Source.Image.Ref).To(Equal("quay.io/operatorhubio/prometheus@fake2.0.0"))
Copy link
Member Author

@m1kola m1kola Oct 20, 2023

Choose a reason for hiding this comment

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

I changed test data (included more packages with higher versions). There is a bunch of tests where we test installing packages without a specific version and the behaviour is to select the latest version. So I had to update the assertions to reflect the latest version.

Changes to the test data & updates to assertions are in separate commit. Reviewing commit-by commit might be more convinient for some.

@m1kola m1kola marked this pull request as ready for review October 20, 2023 14:37
@m1kola m1kola requested a review from a team as a code owner October 20, 2023 14:37
@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 20, 2023
Copy link
Contributor

@dtfranz dtfranz left a comment

Choose a reason for hiding this comment

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

lgtm!

@dtfranz dtfranz added this pull request to the merge queue Oct 20, 2023
Merged via the queue into operator-framework:main with commit 3fc434d Oct 21, 2023
12 checks passed
@m1kola m1kola deleted the upgrade_tests branch October 21, 2023 22:48
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.

Upgrade tests on controller reconcile level
3 participants