cert-manager/pkg/controller
Maël Valais 5c1fba52a5 Mock lister: fix the wrong stack frames for certificaterequests
The stack frames displayed using assert.Fail was not very informative.
That is due to t.Cleanup being called "outside" of the test case
context. There was no mention of the test file itself, gatherer_test.go
in the following example:

 certificaterequest.go:205:
         Error Trace:    certificaterequest.go:205
                                                 testing.go:872
                                                 testing.go:866
                                                 testing.go:873
                                                 testing.go:949
                                                 testing.go:1121
         Error:          lister.CertificateRequests was expected to be called but was not called
         Test:           TestDataForCertificate/should_return_error_when_the_list_func_returns_an_error

With this patch that vendors a simple version of assert.Fail, we get the
correct stack frames that the user needs in order to locate where this
failure happened:

 certificaterequest.go:254:
         Error Trace:    gatherer_test.go:230
                         gatherer_test.go:240
         Error:          lister.CertificateRequests was expected to be called but was not called
         Test:           TestDataForCertificate/should_return_error_when_the_list_func_returns_an_error

Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:16 +01:00
..
acmechallenges Merge pull request #3500 from meyskens/update-copy 2020-12-15 10:12:31 +00:00
acmeorders Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
cainjector Minor log message clarification 2021-01-07 19:21:11 +00:00
certificaterequests Merge pull request #3699 from maelvls/ocsp-unit-test 2021-03-01 19:12:49 +00:00
certificates Mock lister: fix the wrong stack frames for certificaterequests 2021-03-04 17:16:16 +01:00
clusterissuers Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
ingress-shim Revert ingress key usage annotation to default the same as Certificate 2021-02-04 16:08:30 +00:00
issuers Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
test Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
BUILD.bazel Remove unused helper functions 2020-11-19 12:44:18 +00:00
builder.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
context.go Removes the deprecated renew-before-expiry flag 2021-02-21 10:22:25 +00:00
controller.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
helper.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
register.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
util.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00