openshift / aws-account-operator

Operator to manage pool of AWS accounts for Hive
Apache License 2.0
32 stars 75 forks source link

[OSD-8614] Added unit tests for AccountClaim finalizer #641

Closed dkeohane closed 3 years ago

dkeohane commented 3 years ago

Ref: https://issues.redhat.com/browse/OSD-8614

We're looking to improve the stability of the AAO operator by adding more unit tests to catch potential future issue. Here are a body of unit tests to cover the account claim finalizer functions.

codecov-commenter commented 3 years ago

Codecov Report

Merging #641 (a4361a6) into master (a11fd59) will increase coverage by 0.81%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #641      +/-   ##
==========================================
+ Coverage   25.59%   26.41%   +0.81%     
==========================================
  Files          46       46              
  Lines        4555     4555              
==========================================
+ Hits         1166     1203      +37     
+ Misses       3311     3273      -38     
- Partials       78       79       +1     
Impacted Files Coverage Δ
.../controller/accountclaim/accountclaim_finalizer.go 89.36% <0.00%> (+78.72%) :arrow_up:
NautiluX commented 3 years ago

I think the tests could use some more structure, like When - AccountClaim doesn't exist It - won't add a Finalizer It - won't remove a Finalizer that should allow to have more shared BeforeEach blocks and less repetition in Its

but overall /lgtm

iamkirkbater commented 3 years ago

/lgtm

openshift-ci[bot] commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dkeohane, drpaneas, iamkirkbater, NautiluX

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/aws-account-operator/blob/master/OWNERS)~~ [iamkirkbater] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment