Skip to content

Commit

Permalink
update integration test descriptions
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon committed May 30, 2023
1 parent 44d57d4 commit 422f2f9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
18 changes: 13 additions & 5 deletions controllers/certificaterequest_controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ func addIdToNamespace(t *testing.T, testId int, namespace string) string {
func TestCertificateRequestControllerIntegrationIssuerInitiallyNotFoundAndNotReady(t *testing.T) {
t.Parallel()

t.Log(
"Tests to show that the CertificateRequestController watches Issuer and ClusterIssuer resources ",
"and that it re-reconciles all related CertificateRequest resources",
"and that it waits for the issuer to become ready",
)

fieldOwner := "issuer-or-clusterissuer-initially-not-found-and-not-ready"

ctx := testresource.EnsureTestDependencies(t, testcontext.ForTest(t), testresource.UnitTest)
Expand All @@ -94,11 +100,6 @@ func TestCertificateRequestControllerIntegrationIssuerInitiallyNotFoundAndNotRea
},
)

t.Log(
"Tests to show that the controller watches Issuer and ClusterIssuer resources ",
"and that it re-reconciles all related CertificateRequest resources",
"and that it waits for the issuer to become ready",
)
type testCase struct {
name string
issuerType string
Expand Down Expand Up @@ -203,6 +204,13 @@ func TestCertificateRequestControllerIntegrationIssuerInitiallyNotFoundAndNotRea
// TestCertificateRequestControllerIntegrationSetCondition runs the
// CertificateRequestController against a real Kubernetes API server.
func TestCertificateRequestControllerIntegrationSetCondition(t *testing.T) {
t.Parallel()

t.Log(
"Tests to show that the CertificateRequestController handles SetCertificateRequestConditionError errors correctly",
"i.e. it sets the custom condition on the CertificateRequest",
)

fieldOwner := "cr-set-condition"

ctx := testresource.EnsureTestDependencies(t, testcontext.ForTest(t), testresource.UnitTest)
Expand Down
7 changes: 7 additions & 0 deletions controllers/combined_controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ import (
func TestCombinedControllerTemporaryFailedCertificateRequestRetrigger(t *testing.T) { //nolint:tparallel
t.Parallel()

t.Log(
"Tests to show that the CertificateRequest controller handles IssuerErrors from the Sign function correctly",
"i.e. that it updates the CertificateRequest status to Ready=false with a Pending reason",
"and that it updates the Issuer status to Ready=false with a Pending reason or Ready=false with a Failed reason if the IssuerError wraps a PermanentError",
"Additionally, it tests that the Issuer Controller is able to recover from a temporary IssuerError",
)

fieldOwner := "failed-certificate-request-should-retrigger-issuer"

ctx := testresource.EnsureTestDependencies(t, testcontext.ForTest(t), testresource.UnitTest)
Expand Down

0 comments on commit 422f2f9

Please sign in to comment.