From 54b4478b45b990ea5251a639ba1b38abc6e5da78 Mon Sep 17 00:00:00 2001 From: Jeremy Facchetti Date: Mon, 8 Apr 2024 09:07:37 +0200 Subject: [PATCH] added e2e tests --- e2e/plugin/plugin.go | 10 ++++++++++ e2e/test_plugin/main.go | 1 + 2 files changed, 11 insertions(+) diff --git a/e2e/plugin/plugin.go b/e2e/plugin/plugin.go index 6159814f..a03db5ae 100644 --- a/e2e/plugin/plugin.go +++ b/e2e/plugin/plugin.go @@ -192,4 +192,14 @@ var _ = ginkgo.Describe("Plugin test", func() { WithTimeout(pollingDurationLong). Should(gomega.BeTrue()) }) + + ginkgo.It("check the interceptor", func() { + // wait for secret to become synced + vPod := &corev1.Pod{} + err := f.VclusterCRClient.Get(f.Context, types.NamespacedName{Name: "stuff", Namespace: "test"}, vPod) + framework.ExpectNoError(err) + + // check if secret is synced correctly + framework.ExpectEqual(vPod.Name, "definitelynotstuff") + }) }) diff --git a/e2e/test_plugin/main.go b/e2e/test_plugin/main.go index 3d2bb504..e71082b6 100644 --- a/e2e/test_plugin/main.go +++ b/e2e/test_plugin/main.go @@ -31,6 +31,7 @@ func main() { plugin.MustRegister(syncers.NewMyDeploymentSyncer(ctx)) plugin.MustRegister(syncers.NewCarSyncer(ctx)) plugin.MustRegister(syncers.NewImportSecrets(ctx)) + plugin.MustRegister(syncers.DummyInterceptor{}) plugin.MustStart() }