Commit 3ed0da89 authored by Tiffany Rea's avatar Tiffany Rea Committed by Dan Davison

Fix nil pipeline status error

parent 49d462f4
...@@ -63,15 +63,18 @@ module QA ...@@ -63,15 +63,18 @@ module QA
downstream_project.visit! downstream_project.visit!
# Wait for upstream new tag pipeline to succeed Support::Waiter.wait_until(sleep_interval: 3) do
# And downstream project to have 2 pipelines QA::Runtime::Logger.info 'Waiting for upstream pipeline to succeed.'
Support::Waiter.wait_until do
new_pipeline = upstream_project.pipelines.find { |pipeline| pipeline[:ref] == tag_name } new_pipeline = upstream_project.pipelines.find { |pipeline| pipeline[:ref] == tag_name }
new_pipeline[:status] == 'success' && downstream_project.pipelines.size == 2 new_pipeline&.dig(:status) == 'success'
end end
# expect new downstream pipeline to also succeed
Page::Project::Menu.perform(&:click_ci_cd_pipelines) Page::Project::Menu.perform(&:click_ci_cd_pipelines)
# Downstream project must have 2 pipelines at this time
expect(downstream_project.pipelines.size).to eq(2), "There are currently #{downstream_project.pipelines.size} pipelines in downstream project."
# expect new downstream pipeline to also succeed
Page::Project::Pipeline::Index.perform do |index| Page::Project::Pipeline::Index.perform do |index|
expect(index.wait_for_latest_pipeline_succeeded).to be_truthy, 'Downstream pipeline did not succeed as expected.' expect(index.wait_for_latest_pipeline_succeeded).to be_truthy, 'Downstream pipeline did not succeed as expected.'
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment