-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from PennyLaneAI/wae_reporting
Warnings as error reporting
- Loading branch information
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/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 | ||
# the severity or importance of rectification. | ||
|
||
JOBID=$(gh run list -w "Test-suite with Python warnings as errors" -L 1 --json databaseId -q '.[0].databaseId') | ||
echo "View latest job at https://github.com/PennyLaneAI/pennylane/actions/runs/$JOBID" | ||
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters