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

Remove ginkgo from api tests #399

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Sep 6, 2023

This is related to epic #189, although there doesn't seem to be a related issue for this directory.

Description

Reviewer Checklist

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

@tmshort tmshort requested a review from a team as a code owner September 6, 2023 20:25
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.22% ⚠️

Comparison is base (98e3e2e) 81.64% compared to head (168b05d) 81.43%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
- Coverage   81.64%   81.43%   -0.22%     
==========================================
  Files          21       21              
  Lines         937      937              
==========================================
- Hits          765      763       -2     
- Misses        119      120       +1     
- Partials       53       54       +1     
Flag Coverage Δ
e2e 61.57% <ø> (-0.22%) ⬇️
unit 77.23% <ø> (ø)

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.

@tmshort
Copy link
Contributor Author

tmshort commented Sep 6, 2023

@ncdc baby steps to removing Ginkgo...

Copy link
Member

@ncdc ncdc left a comment

Choose a reason for hiding this comment

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

The conditionsets package variables don't seem to be used anywhere / these tests are ... 🤷 ?

api/v1alpha1/operator_types_test.go Outdated Show resolved Hide resolved
api/v1alpha1/operator_types_test.go Outdated Show resolved Hide resolved
@tmshort
Copy link
Contributor Author

tmshort commented Sep 7, 2023

The conditionsets package variables don't seem to be used anywhere / these tests are ... 🤷 ?

@joelanford added these tests, see #122

@ncdc
Copy link
Member

ncdc commented Sep 7, 2023

Interesting, I haven't seen anyone validate that every condition is set post-reconcile before.

@joelanford
Copy link
Member

Interesting, I haven't seen anyone validate that every condition is set post-reconcile before.

WDYT about that?

I set that test up as a reaction to seeing various reconcilers not properly update conditions when Reconcile doesn't follow the happy path. This essentially forces all tested code paths to think about how all of the conditions should be set, and it somewhat guards against the possibility of multiple reconciles being necessary to fully process a change/update.

@ncdc
Copy link
Member

ncdc commented Sep 7, 2023

In other projects, our reconcilers added conditions when they were relevant, and didn't ensure 100% of the possible conditions were present 100% of the time. I'm not against the validation, although the purist in me would rather not see exported package level variables that only exist to serve unit tests. But we don't need to debate the pros/cons of that in this PR.

@ncdc ncdc enabled auto-merge September 7, 2023 13:51
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 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 Sep 7, 2023
@tmshort
Copy link
Contributor Author

tmshort commented Sep 7, 2023

@ncdc, I had to rebase, and handle a lint issue due to a comment format issue!

This is related to epic operator-framework#189, although there doesn't seem to be a related
issue for this directory.

Signed-off-by: Todd Short <tshort@redhat.com>
@ncdc ncdc added this pull request to the merge queue Sep 7, 2023
Merged via the queue into operator-framework:main with commit 1ec4a23 Sep 7, 2023
11 of 12 checks passed
@tmshort tmshort deleted the test-api branch September 7, 2023 14:58
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

4 participants