Merge pull request #1521 from XiShanYongYe-Chang/e2e-move-clean-operation
[E2E] move clean operation to AfterEach
This commit is contained in:
commit
e3271edc6b
|
@ -257,6 +257,19 @@ var _ = ginkgo.Describe("[MCS] Multi-Cluster Service testing", func() {
|
|||
framework.RemoveService(exportClusterClient, demoService.Namespace, demoService.Name)
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
ginkgo.By("Cleanup", func() {
|
||||
err := controlPlaneClient.Delete(context.TODO(), &serviceExport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
|
||||
err = controlPlaneClient.Delete(context.TODO(), &serviceImport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
})
|
||||
|
||||
framework.RemovePropagationPolicy(karmadaClient, exportPolicy.Namespace, exportPolicy.Name)
|
||||
framework.RemovePropagationPolicy(karmadaClient, importPolicy.Namespace, importPolicy.Name)
|
||||
})
|
||||
|
||||
ginkgo.It("Export Service from source-clusters, import Service to destination-clusters", func() {
|
||||
importClusterClient := framework.GetClusterClient(serviceImportClusterName)
|
||||
gomega.Expect(importClusterClient).ShouldNot(gomega.BeNil())
|
||||
|
@ -346,17 +359,6 @@ var _ = ginkgo.Describe("[MCS] Multi-Cluster Service testing", func() {
|
|||
return podLogs(context.TODO(), importClusterClient, demoService.Namespace, pod.Name)
|
||||
}, pollTimeout, pollInterval).Should(gomega.Equal("hello\n"))
|
||||
})
|
||||
|
||||
ginkgo.By("Cleanup", func() {
|
||||
err := controlPlaneClient.Delete(context.TODO(), &serviceExport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
|
||||
err = controlPlaneClient.Delete(context.TODO(), &serviceImport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
})
|
||||
|
||||
framework.RemovePropagationPolicy(karmadaClient, exportPolicy.Namespace, exportPolicy.Name)
|
||||
framework.RemovePropagationPolicy(karmadaClient, importPolicy.Namespace, importPolicy.Name)
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -400,6 +402,19 @@ var _ = ginkgo.Describe("[MCS] Multi-Cluster Service testing", func() {
|
|||
framework.RemoveService(exportClusterClient, demoService.Namespace, demoService.Name)
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
ginkgo.By("Cleanup", func() {
|
||||
err := controlPlaneClient.Delete(context.TODO(), &serviceExport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
|
||||
err = controlPlaneClient.Delete(context.TODO(), &serviceImport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
})
|
||||
|
||||
framework.RemovePropagationPolicy(karmadaClient, exportPolicy.Namespace, exportPolicy.Name)
|
||||
framework.RemovePropagationPolicy(karmadaClient, importPolicy.Namespace, importPolicy.Name)
|
||||
})
|
||||
|
||||
ginkgo.It("Update Deployment's replicas", func() {
|
||||
exportClusterClient := framework.GetClusterClient(serviceExportClusterName)
|
||||
gomega.Expect(exportClusterClient).ShouldNot(gomega.BeNil())
|
||||
|
@ -467,17 +482,6 @@ var _ = ginkgo.Describe("[MCS] Multi-Cluster Service testing", func() {
|
|||
return epNums, nil
|
||||
}, pollTimeout, pollInterval).Should(gomega.Equal(2))
|
||||
})
|
||||
|
||||
ginkgo.By("Cleanup", func() {
|
||||
err := controlPlaneClient.Delete(context.TODO(), &serviceExport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
|
||||
err = controlPlaneClient.Delete(context.TODO(), &serviceImport)
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
})
|
||||
|
||||
framework.RemovePropagationPolicy(karmadaClient, exportPolicy.Namespace, exportPolicy.Name)
|
||||
framework.RemovePropagationPolicy(karmadaClient, importPolicy.Namespace, importPolicy.Name)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue