Skip to content

Commit

Permalink
Add WAE script
Browse files Browse the repository at this point in the history
  • Loading branch information
mlxd committed Nov 13, 2024
1 parent 59ba241 commit c9b718c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/scripts/unique_warning_reporter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# This file determines and counts the unique warnings that appear in the test suite using the
# warnings-as-errors action runs. The volume of each reported warning can be used to indicate
# severity or importance for rectification.

JOBID=$(gh run list -w "Test-suite with Python warnings as errors" -L 1 --json databaseId -q '.[0].databaseId')
gh run view $JOBID --log-failed >/tmp/job_$JOBID.out
cat /tmp/job_$JOBID.out | grep "Warning:" | awk '{split($0,a,"Warning:"); print a[1]"Warning"}' | awk '{split($0,a," - "); print a[2]}' | sort -u >unique_wae.txt

declare -A waeCounts

while read -r line; do
[[ -n "$line" && "$line" != [[:blank:]#]* ]] && waeCounts["$line"]=$(cat /tmp/job_$JOBID.out | grep "$line" | wc -l)
done <unique_wae.txt
echo $waeCounts

jsonOut="[{"
for x in "${!waeCounts[@]}"; do
echo $x :: ${waeCounts[$x]}
jsonOut+="\"$x\":${waeCounts[$x]},"
done
jsonOut="${jsonOut::-1}}]"
echo $jsonOut >unique_wae.json

0 comments on commit c9b718c

Please sign in to comment.