From f3fc01307009a94a026b6ab4318074eb738ac3c8 Mon Sep 17 00:00:00 2001 From: dblock Date: Tue, 26 Nov 2024 10:33:06 -0500 Subject: [PATCH] Display missing test paths in a GitHub compatible format. Signed-off-by: dblock --- .github/workflows/analyze-pr-changes.yml | 2 +- .github/workflows/test-spec.yml | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/analyze-pr-changes.yml b/.github/workflows/analyze-pr-changes.yml index 1c043d05d..c9f143961 100644 --- a/.github/workflows/analyze-pr-changes.yml +++ b/.github/workflows/analyze-pr-changes.yml @@ -124,7 +124,7 @@ jobs: (map(.endpoints .covered | to_entries | sort_by(.value) | map((.value[] | ascii_upcase) + " " + .key)) | .[] | to_entries | map({path: .value, covered: true})) as $covered | $covered+$uncovered | sort_by(.path) | - map(if .covered then "-[x] \(.path)" else "-[ ] \(.path)" end) | + map(if .covered then "- [x] \(.path)" else "- [ ] \(.path)" end) | .[] ' $AFTER_COVERAGE | jq -r diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 895ac1e4d..b7213aa84 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -126,14 +126,16 @@ jobs: - name: Display Missing Test Paths run: | - jq -sc ' - (map(.operations) | add | unique) as $all | - (map(.evaluated_operations) | add | unique) as $evaluated | - $all-$evaluated | - sort_by(.path) | - .[] | - "\(.method) \(.path)" - ' $(find ./ -name "test-spec-coverage-*.json") + jq -r -sc ' + (map(.operations) | add | unique) as $all | + (map(.evaluated_operations) | add | unique) as $evaluated | + ($all-$evaluated | map({path: .path, method: .method, evaluated: false})) as $unevaluated | + ($evaluated | map({path: .path, method: .method, evaluated: true})) as $evaluated | + $evaluated+$unevaluated | + sort_by(.path) | + map(if .evaluated then "- [x] \(.method) \(.path)" else "- [ ] \(.method) \(.path)" end) | + .[] + ' $(find ./ -name "test-spec-coverage-*.json") - name: Combine Test Coverage Data shell: bash -eo pipefail {0}