Skip to content

Commit

Permalink
fix(KONFLUX-5718): fix afterall to close merge request even it failed (
Browse files Browse the repository at this point in the history
…#1490)

Signed-off-by: Kasem Alem <[email protected]>
Co-authored-by: Kasem Alem <[email protected]>
  • Loading branch information
kasemAlem and Kasem Alem authored Jan 29, 2025
1 parent 3116e43 commit 118ccac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/integration-service/gitlab-integration-reporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 118ccac

Please sign in to comment.