Skip to content

Commit

Permalink
debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreylimnardy committed Feb 3, 2025
1 parent 0b9eea8 commit 77ecd9e
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package e2e

import (
"context"
"fmt"
"testing"

. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -81,18 +82,32 @@ var _ = BeforeSuite(func() {
})

var _ = AfterSuite(func() {
Expect(kitk8s.DeleteObjects(ctx, k8sClient, k8sObjects...)).Should(Succeed())
fmt.Printf("Starting AfterSuite cleanup\n")

Check failure on line 85 in test/e2e/suite_test.go

View workflow job for this annotation

GitHub Actions / lint

use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)

err := kitk8s.DeleteObjects(ctx, k8sClient, k8sObjects...)
fmt.Printf("DeleteObjects result: %v\n", err)

Check failure on line 88 in test/e2e/suite_test.go

View workflow job for this annotation

GitHub Actions / lint

use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
Expect(err).Should(Succeed())

if !suite.IsOperational() {
fmt.Printf("Suite not operational, checking resources\n")

Check failure on line 92 in test/e2e/suite_test.go

View workflow job for this annotation

GitHub Actions / lint

use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
Eventually(func(g Gomega) {
var validatingWebhookConfiguration admissionregistrationv1.ValidatingWebhookConfiguration
g.Expect(k8sClient.Get(ctx, client.ObjectKey{Name: kitkyma.ValidatingWebhookName}, &validatingWebhookConfiguration)).Should(Succeed())
var validatingWebhook admissionregistrationv1.ValidatingWebhookConfiguration
var secret corev1.Secret
g.Expect(k8sClient.Get(ctx, kitkyma.WebhookCertSecret, &secret)).Should(Succeed())

webhookErr := k8sClient.Get(ctx, client.ObjectKey{Name: kitkyma.ValidatingWebhookName}, &validatingWebhook)
fmt.Printf("Webhook check: %v\n", webhookErr)

secretErr := k8sClient.Get(ctx, kitkyma.WebhookCertSecret, &secret)
fmt.Printf("Secret check: %v\n", secretErr)

g.Expect(webhookErr).Should(Succeed())
g.Expect(secretErr).Should(Succeed())
}, periodic.EventuallyTimeout, periodic.DefaultInterval).ShouldNot(Succeed())
}

fmt.Printf("Cancelling context and stopping test environment\n")
cancel()
By("tearing down the test environment")
err := testEnv.Stop()
err = testEnv.Stop()
fmt.Printf("TestEnv stop result: %v\n", err)
Expect(err).NotTo(HaveOccurred())
})

0 comments on commit 77ecd9e

Please sign in to comment.