diff --git a/tests/functions.sh b/tests/functions.sh index 0e48d378..a0b65616 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -537,8 +537,11 @@ function approve_pull_request () { exit 1 fi fi - real_title=$(echo $all_prs | jq -r --arg pr_title "$pr_title" 'select(.[].title | startswith($pr_title)) | .[].title' | head -n 1) + real_title=$(echo $all_prs | jq -r --arg pr_title "$pr_title" '.[] | select(.title | startswith($pr_title)) | .title' | head -n 1) pull_request_id=$(echo $all_prs | jq -r --arg pr_title "$pr_title" 'select(.[0].title | startswith($pr_title)) | .[0].pullRequestId') + if [ "$pull_request_id" == "" ]; then + pull_request_id=$(echo $all_prs | jq -r --arg pr_title "$pr_title" '.[] | select(.title | startswith($pr_title)) | .pullRequestId' | head -n 1) + fi echo "Found pull request starting with phrase '$pr_title'" echo "Pull request id $pull_request_id is '$real_title'" diff --git a/tests/validations.sh b/tests/validations.sh index 9fdd642f..2661bd80 100644 --- a/tests/validations.sh +++ b/tests/validations.sh @@ -397,6 +397,7 @@ git push -u origin --all # Wait for the lifecycle pipeline to finish and approve the pull request mono_repo_commit_id=$(git log --format="%H" -n 1) +verify_pipeline_with_poll_and_source_version $AZDO_ORG_URL $AZDO_PROJECT $frontend_pipeline_name 500 15 $mono_repo_commit_id verify_pipeline_with_poll_and_source_version $AZDO_ORG_URL $AZDO_PROJECT $lifecycle_pipeline_name 300 15 $mono_repo_commit_id echo "Finding pull request that $lifecycle_pipeline_name pipeline created..." approve_pull_request $AZDO_ORG_URL $AZDO_PROJECT "Reconciling HLD"