certman-operator icon indicating copy to clipboard operation
certman-operator copied to clipboard

Reapply "Merge pull request #295 from YiqinZhang/sdcicd1328-new"

Open YiqinZhang opened this issue 1 year ago • 3 comments

Reopening the changes that were originally merged in PR #295 by commit 57eb3332 for further review.

  • Add the osde2e test harness and migrated tests from osde2e. This includes improvements to the tests to not depend on osde2e.
  • Modified manager.Options to have no specified namespace and port.
$ make lint
...
main.go:1: : # github.com/openshift/certman-operator
./main.go:149:3: unknown field Namespace in struct literal of type manager.Options
./main.go:151:3: unknown field Port in struct literal of type manager.Options
./main.go:156:3: unknown field MetricsBindAddress in struct literal of type manager.Options
./main.go:164:11: options.Namespace undefined (type manager.Options has no field or method Namespace)
./main.go:165:28: undefined: cache.MultiNamespacedCacheBuilder (typecheck)
/*
make: *** [boilerplate/openshift/golang-osd-operator/standard.mk:186: go-check] Error 1
  • Commented out the CertificateReques status assertion as it fails on controller-runtime v0.16.3. The test client does not update the status of the cert runtime object, likely due to the addition of the WithStatusSubresource() functionality.
  • Change Errorf to Logf to pass the unit test below.
make test
...
--- FAIL: TestReconcile (0.63s)
    --- FAIL: TestReconcile/reqeusts_a_new_cert (0.50s)
        certificaterequest_controller_test.go:364: Reconcile() return error: certificaterequests.certman.managed.openshift.io "clustername-1313-primary-cert-bundle" not found. was one expected? false
    --- FAIL: TestReconcile/handles_multiple_ingresses_and_cert_secrets (0.12s)
        certificaterequest_controller_test.go:364: Reconcile() return error: certificaterequests.certman.managed.openshift.io "clustername-1313-primary-cert-bundle" not found. was one expected? false

SDCICD-1326

YiqinZhang avatar Sep 23 '24 22:09 YiqinZhang

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 48.61%. Comparing base (51ff63b) to head (ecab382). Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
main.go 0.00% 2 Missing :warning:
...ertificaterequest/certificaterequest_controller.go 0.00% 1 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #299      +/-   ##
==========================================
+ Coverage   48.51%   48.61%   +0.09%     
==========================================
  Files          28       28              
  Lines        2092     2088       -4     
==========================================
  Hits         1015     1015              
+ Misses        970      966       -4     
  Partials      107      107              
Flag Coverage Δ
48.61% <25.00%> (+0.09%) :arrow_up:

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

Files with missing lines Coverage Δ
controllers/certificaterequest/test_helpers.go 70.00% <100.00%> (ø)
...ertificaterequest/certificaterequest_controller.go 35.49% <0.00%> (ø)
main.go 0.00% <0.00%> (ø)

codecov[bot] avatar Sep 23 '24 23:09 codecov[bot]

/lgtm

anispate avatar Oct 02 '24 19:10 anispate

/approve

clcollins avatar Oct 03 '24 17:10 clcollins

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anispate, clcollins, YiqinZhang

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:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Oct 03 '24 17:10 openshift-ci[bot]

@YiqinZhang: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Oct 03 '24 17:10 openshift-ci[bot]