Skip to content

Commit 3ffa191

Browse files
glevi-rhclaude
andauthored
fix: use WaitForIntegrationPipelineToBeFinished instead of HasStarted (#1803)
Prevent merge steps from running before integration PLR completes. Co-authored-by: Claude <noreply@anthropic.com>
1 parent c7917a8 commit 3ffa191

1 file changed

Lines changed: 6 additions & 33 deletions

File tree

tests/integration-service/group-snapshots-tests.go

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,8 @@ var _ = framework.IntegrationServiceSuiteDescribe("Creation of group snapshots f
268268
})
269269

270270
ginkgo.It("integration pipeline should end up with success", func() {
271-
gomega.Eventually(func() error {
272-
integrationPipelineRun, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentA.Name, applicationName, testNamespace, "")
273-
if err != nil {
274-
ginkgo.GinkgoWriter.Printf("Integraiton PipelineRun has not been created yet for the componentA %s/%s\n", testNamespace, componentA.Name)
275-
return err
276-
}
277-
if !integrationPipelineRun.HasStarted() {
278-
return fmt.Errorf("integration pipelinerun %s in namespace %s hasn't started yet", integrationPipelineRun.GetName(), integrationPipelineRun.GetNamespace())
279-
}
280-
return nil
281-
}, longTimeout, constants.PipelineRunPollingInterval).Should(gomega.Succeed(), fmt.Sprintf("timed out when waiting for the build PipelineRun to start for the componentA %s/%s", testNamespace, componentA.Name))
271+
gomega.Expect(f.AsKubeDeveloper.IntegrationController.WaitForIntegrationPipelineToBeFinished(integrationTestScenarioPass, snapshot, testNamespace)).To(gomega.Succeed(),
272+
fmt.Sprintf("timed out waiting for integration pipeline to succeed for componentA %s/%s", testNamespace, componentA.Name))
282273
})
283274
})
284275

@@ -368,17 +359,8 @@ var _ = framework.IntegrationServiceSuiteDescribe("Creation of group snapshots f
368359
})
369360

370361
ginkgo.It("integration pipeline should end up with success", func() {
371-
gomega.Eventually(func() error {
372-
integrationPipelineRun, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentB.Name, applicationName, testNamespace, "")
373-
if err != nil {
374-
ginkgo.GinkgoWriter.Printf("Integraiton PipelineRun has not been created yet for the componentB %s/%s\n", testNamespace, componentB.Name)
375-
return err
376-
}
377-
if !integrationPipelineRun.HasStarted() {
378-
return fmt.Errorf("integration pipelinerun %s in namespace %s hasn't started yet", integrationPipelineRun.GetName(), integrationPipelineRun.GetNamespace())
379-
}
380-
return nil
381-
}, longTimeout, constants.PipelineRunPollingInterval).Should(gomega.Succeed(), fmt.Sprintf("timed out when waiting for the build PipelineRun to start for the componentB %s/%s", testNamespace, componentB.Name))
362+
gomega.Expect(f.AsKubeDeveloper.IntegrationController.WaitForIntegrationPipelineToBeFinished(integrationTestScenarioPass, snapshot, testNamespace)).To(gomega.Succeed(),
363+
fmt.Sprintf("timed out waiting for integration pipeline to succeed for componentB %s/%s", testNamespace, componentB.Name))
382364
})
383365
})
384366

@@ -468,17 +450,8 @@ var _ = framework.IntegrationServiceSuiteDescribe("Creation of group snapshots f
468450
})
469451

470452
ginkgo.It("integration pipeline should end up with success", func() {
471-
gomega.Eventually(func() error {
472-
integrationPipelineRun, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentC.Name, applicationName, testNamespace, "")
473-
if err != nil {
474-
ginkgo.GinkgoWriter.Printf("Integraiton PipelineRun has not been created yet for the componentC %s/%s\n", testNamespace, componentC.Name)
475-
return err
476-
}
477-
if !integrationPipelineRun.HasStarted() {
478-
return fmt.Errorf("integration pipelinerun %s in namespace %s hasn't started yet", integrationPipelineRun.GetName(), integrationPipelineRun.GetNamespace())
479-
}
480-
return nil
481-
}, longTimeout, constants.PipelineRunPollingInterval).Should(gomega.Succeed(), fmt.Sprintf("timed out when waiting for the build PipelineRun to start for the componentC %s/%s", testNamespace, componentC.Name))
453+
gomega.Expect(f.AsKubeDeveloper.IntegrationController.WaitForIntegrationPipelineToBeFinished(integrationTestScenarioPass, snapshot, testNamespace)).To(gomega.Succeed(),
454+
fmt.Sprintf("timed out waiting for integration pipeline to succeed for componentC %s/%s", testNamespace, componentC.Name))
482455
})
483456
})
484457

0 commit comments

Comments
 (0)