Skip to content

Commit

Permalink
Display missing test paths in a GitHub compatible format.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Nov 26, 2024
1 parent 8df8a42 commit f3fc013
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analyze-pr-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit f3fc013

Please sign in to comment.