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

🌱 Update installed package unit tests #524

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Nov 8, 2023

Description

This commit does two things.

First: It splits the TestMakeInstalledPackageVariables test into two tests:

  • One for when ForceSemverUpgradeConstraints feature gate enabled (semver)
  • One for when ForceSemverUpgradeConstraints feature gate disabled (legacy semantics)

Both tests are now table-style tests.

This is done mainly so that we can maintain test data for different semantics separately (e.g. no need to maintain channel entires for semver tests).

Second: Adds extra coverage for disabled state of the ForceSemverUpgradeConstraints feature gate. Previously we were not covering some cases for this state of the gate. Example of such case is when UpgradeConstraintPolicy field on Operator is set to Ignore.

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 Nov 8, 2023
@m1kola m1kola force-pushed the installed_package_test_cmp branch 2 times, most recently from bbf0693 to 800d435 Compare November 8, 2023 15:55
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f147e61) 84.72% compared to head (75a6f8a) 84.50%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
- Coverage   84.72%   84.50%   -0.22%     
==========================================
  Files          23       23              
  Lines         910      910              
==========================================
- Hits          771      769       -2     
- Misses         95       96       +1     
- Partials       44       45       +1     
Flag Coverage Δ
e2e 66.04% <ø> (-0.22%) ⬇️
unit 79.50% <ø> (ø)

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

see 1 file with indirect coverage changes

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

@m1kola m1kola force-pushed the installed_package_test_cmp branch from 800d435 to dcfc7ad Compare November 8, 2023 16:06
@m1kola m1kola marked this pull request as ready for review November 8, 2023 16:11
@m1kola m1kola requested a review from a team as a code owner November 8, 2023 16:11
@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 Nov 8, 2023
This commit does two things.

First: It splits the `TestMakeInstalledPackageVariables` test into two tests:
* One for when `ForceSemverUpgradeConstraints` feature gate enabled (semver)
* One for when `ForceSemverUpgradeConstraints` feature gate disabled (legacy semantics)

Both tests are now table-style tests.

This is done mainly so that we can maintain test data for different semantics separately (e.g. no need to maintain channel entires for semver tests).

Second: Adds extra coverage for disabled state of the `ForceSemverUpgradeConstraints`
feature gate. Previously we were not covering some cases for this state of the gate.
Example of such case is when `UpgradeConstraintPolicy` field on `Operator` is set to `Ignore`.

Signed-off-by: Mikalai Radchuk <[email protected]>
@m1kola m1kola force-pushed the installed_package_test_cmp branch from dcfc7ad to 75a6f8a Compare November 10, 2023 15:51
@m1kola m1kola requested a review from awgreene November 10, 2023 15:53
Copy link
Member

@awgreene awgreene left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks @m1kola

@awgreene awgreene added this pull request to the merge queue Nov 10, 2023
Merged via the queue into operator-framework:main with commit 7e321b4 Nov 10, 2023
@m1kola m1kola deleted the installed_package_test_cmp branch November 10, 2023 16:26
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.

2 participants