diff --git a/src/jobs/e2e/collect-e2e-logs.yml b/src/jobs/e2e/collect-e2e-logs.yml index 43cf0ce4..7b4fabbd 100644 --- a/src/jobs/e2e/collect-e2e-logs.yml +++ b/src/jobs/e2e/collect-e2e-logs.yml @@ -84,13 +84,33 @@ steps: - run: name: Wait for smoke test jobs to complete command: | - # Loop through to check if each of the jobs have been completed - for job in $(echo "<< parameters.smoke-test-jobs >>" | tr "," "\n"); do - while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLE_TOKEN"| jq -r ".items[]|select(.name == \"$job\")|.status" | grep -c "running") -gt 0 ]] - do - sleep 5 - done + FILTER=$(cat <>" "$FILTER" \ + | tee -a job-status.log \ + | jq -r 'map(select(.status == "running")) | length' + ) -gt 0 ]]; do + sleep 5 done + + cat job-status.log + - run: echo "All required jobs have now completed" - run: name: Gather Kubernetes state after run