From c9b718c3fe77e2131944f9d02df3e673252282fd Mon Sep 17 00:00:00 2001 From: "Lee J. O'Riordan" Date: Wed, 13 Nov 2024 12:41:35 -0500 Subject: [PATCH] Add WAE script --- .../scripts/unique_warning_reporter.sh | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/scripts/unique_warning_reporter.sh diff --git a/.github/workflows/scripts/unique_warning_reporter.sh b/.github/workflows/scripts/unique_warning_reporter.sh new file mode 100644 index 0000000..c548d2b --- /dev/null +++ b/.github/workflows/scripts/unique_warning_reporter.sh @@ -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.json