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

Update test descriptions for integration tests #17

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions controllers/certificaterequest_controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,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 @@ -92,11 +98,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 @@ -201,6 +202,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 @@ -47,6 +47,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