From d93dea9ef363c95df0d20dfd3761e0846d395460 Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Mon, 2 Sep 2024 18:08:01 +0200 Subject: [PATCH 1/3] fix(e2e): Get the most recent pod in e2e tests --- e2e/support/test_support.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index 4f2c59b043..f6025e7481 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -36,6 +36,7 @@ import ( "reflect" "regexp" "runtime/debug" + "sort" "strings" "sync" "testing" @@ -546,6 +547,10 @@ func IntegrationPod(t *testing.T, ctx context.Context, ns string, name string) f if len(pods) == 0 { return nil } + + sort.SliceStable(pods, func(i, j int) bool { + return pods[i].GetCreationTimestamp().Time.After(pods[j].GetCreationTimestamp().Time) + }) return &pods[0] } } From 5f403367b3ea3e8f10c9458dd2ece7d10bdbac6d Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Wed, 21 Aug 2024 10:07:06 +0200 Subject: [PATCH 2/3] fix(e2e): Cron e2e logs --- e2e/common/misc/files/cron-yaml.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/common/misc/files/cron-yaml.yaml b/e2e/common/misc/files/cron-yaml.yaml index e238e2e026..2d6a3e8a0f 100644 --- a/e2e/common/misc/files/cron-yaml.yaml +++ b/e2e/common/misc/files/cron-yaml.yaml @@ -18,7 +18,7 @@ - from: uri: "cron:tab" parameters: - schedule: "* * * * ?" + schedule: "*/2 * * * ?" steps: - setHeader: name: "m" From 02f0fbb81c51faf492d450d5a5630b1a379890a9 Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Wed, 21 Aug 2024 11:36:16 +0200 Subject: [PATCH 3/3] chore(e2e): Add cronjobs to test support dump --- e2e/support/util/dump.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/e2e/support/util/dump.go b/e2e/support/util/dump.go index a2e18c213c..fa06dcdba3 100644 --- a/e2e/support/util/dump.go +++ b/e2e/support/util/dump.go @@ -320,6 +320,21 @@ func Dump(ctx context.Context, c client.Client, ns string, t *testing.T) error { } } + // Cronjobs + cronjobs, err := c.BatchV1().CronJobs(ns).List(ctx, metav1.ListOptions{}) + if err != nil { + return err + } + t.Logf("\nFound %d cronjobs:\n", len(cronjobs.Items)) + for _, cronjobs := range cronjobs.Items { + ref := cronjobs + data, err := kubernetes.ToYAMLNoManagedFields(&ref) + if err != nil { + return err + } + t.Logf("---\n%s\n---\n", string(data)) + } + // OLM CSV csvs := olm.ClusterServiceVersionList{} err = c.List(ctx, &csvs, ctrl.InNamespace(ns))