diff --git a/tests/integration-service/gitlab-integration-reporting.go b/tests/integration-service/gitlab-integration-reporting.go index 4e47aa65d..0cbc33042 100644 --- a/tests/integration-service/gitlab-integration-reporting.go +++ b/tests/integration-service/gitlab-integration-reporting.go @@ -81,15 +81,17 @@ var _ = framework.IntegrationServiceSuiteDescribe("Gitlab Status Reporting of In }) AfterAll(func() { - if !CurrentSpecReport().Failed() { - Expect(f.AsKubeAdmin.HasController.DeleteApplication(applicationName, testNamespace, false)).To(Succeed()) - Expect(f.SandboxController.DeleteUserSignup(f.UserName)).To(BeTrue()) - } // Cleanup test: close MR if opened, delete created branch, delete associated Webhooks Expect(f.AsKubeAdmin.CommonController.Gitlab.CloseMergeRequest(projectID, mrID)).NotTo(HaveOccurred()) Expect(f.AsKubeAdmin.CommonController.Gitlab.DeleteBranch(projectID, componentBaseBranchName)).NotTo(HaveOccurred()) Expect(f.AsKubeAdmin.CommonController.Gitlab.DeleteWebhooks(projectID, f.ClusterAppDomain)).NotTo(HaveOccurred()) + + if !CurrentSpecReport().Failed() { + Expect(f.AsKubeAdmin.HasController.DeleteApplication(applicationName, testNamespace, false)).To(Succeed()) + Expect(f.SandboxController.DeleteUserSignup(f.UserName)).To(BeTrue()) + } + }) When("a new Component with specified custom branch is created", Label("custom-branch"), func() {