Skip to content

Commit

Permalink
PI-1414 update pipeline to allow auto passing of projects
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj committed Sep 27, 2023
1 parent aa4f1e0 commit 62c3edc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:
with:
repository: ministryofjustice/hmpps-probation-integration-e2e-tests
ref: ${{ inputs.test-branch }}
- name: Set auto-passing projects
run: echo "auto-pass-projects=['manage-offences-and-delius']" | tee -a "$GITHUB_ENV"
- name: Get tests to run - all tests
if: inputs.projects == '' || inputs.projects == 'All'
run: echo "projects=$(find projects -mindepth 1 -maxdepth 1 -printf "%f\n" | jq --raw-input . | jq --slurp --compact-output .)" | tee -a "$GITHUB_ENV"
Expand Down Expand Up @@ -149,6 +151,13 @@ jobs:
failed_projects=$(jq -r '.suites[].specs[] | select(.ok == false).file' results.json | xargs -n1 dirname | sort -u | jq --raw-input . | jq --slurp --compact-output .)
passed_projects=$(jq --compact-output --null-input --argjson all "$all_projects" --argjson failed "$failed_projects" --argjson skipped "$skipped_projects" '{all: $all, failed: $failed, skipped: $skipped} | .all - .failed - .skipped')
fi
echo "$auto-pass-projects" | jq -c '.[]' | while read app; do
if [[ $(echo "$projects" | jq "any(.[]; . == $app)") == true ]]
then
passed_projects=$(echo "$passed_projects" | jq ". += [$app]")
echo "$passed_projects"
fi
done
echo "skipped-projects=${skipped_projects:-'[]'}" | tee -a "$GITHUB_OUTPUT"
echo "failed-projects=${failed_projects:-'[]'}" | tee -a "$GITHUB_OUTPUT"
echo "passed-projects=${passed_projects:-'[]'}" | tee -a "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 62c3edc

Please sign in to comment.