Skip to content

Commit 132243f

Browse files
committed
modify wae script
1 parent 29925f3 commit 132243f

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/scripts/unique_warning_reporter.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,24 @@
77
JOBID=$(gh run list -w "Test-suite with Python warnings as errors" --repo PennylaneAI/pennylane -L 1 --json databaseId -q '.[0].databaseId')
88
echo "View latest job at https://github.com/PennyLaneAI/pennylane/actions/runs/$JOBID"
99
gh run view $JOBID --log-failed --repo PennylaneAI/pennylane >/tmp/job_$JOBID.out
10-
cat /tmp/job_$JOBID.out | grep "Warning:" | awk '{split($0,a,"Warning:"); print a[1]"Warning"}' | awk '{split($0,a," "); print a[3]}' | sort -u >unique_wae.txt
10+
11+
cat <<EOF > unique_wae.txt
12+
FutureWarning
13+
pennylane.exceptions.PennyLaneDeprecationWarning
14+
pytest.PytestCollectionWarning
15+
RuntimeWarning
16+
numpy.exceptions.ComplexWarning
17+
pytest.PytestUnraisableExceptionWarning
18+
PendingDeprecationWarning
19+
pytest.PytestRemovedIn9Warning
20+
UserWarning
21+
DeprecationWarning
22+
EOF
1123

1224
declare -A waeCounts
1325

1426
while read -r line; do
15-
[[ -n "$line" && "$line" != [[:blank:]]* ]] && waeCounts["$line"]=$(cat /tmp/job_$JOBID.out | grep "$line" | wc -l)
27+
[[ -n "$line" && "$line" != [[:blank:]]* ]] && waeCounts["$line"]=$(grep -F -c "$line" "/tmp/job_$JOBID.out")
1628
done <unique_wae.txt
1729
echo $waeCounts
1830

0 commit comments

Comments
 (0)