summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Alfonsi <laurent.alfonsi@linaro.org>2022-09-18 22:00:19 +0200
committerLaurent Alfonsi <laurent.alfonsi@linaro.org>2022-09-19 16:03:28 +0000
commit215e4cd3c2231ad718cf757f114f6720acdca818 (patch)
tree1e2950ea24d415dd282eacf1f5af9e86b1805fcf
parent41e0e60e9b36dee863f44521b9047cb51b4b52a5 (diff)
tcwg-report-stale-rr-jobs.sh: Add delay per component, output file
.. delay_per_component : because we now can run ci with last commit commit beeing 6-10 days old. which make report-stale-jobs to shout. .. output : to allow "set -x" traces Change-Id: Ic5662200b8696719c715a8f9c629f0de385d74d3
-rwxr-xr-xtcwg-report-stale-rr-jobs.sh49
1 files changed, 29 insertions, 20 deletions
diff --git a/tcwg-report-stale-rr-jobs.sh b/tcwg-report-stale-rr-jobs.sh
index 0575588a..92b97fe2 100755
--- a/tcwg-report-stale-rr-jobs.sh
+++ b/tcwg-report-stale-rr-jobs.sh
@@ -10,6 +10,7 @@ convert_args_to_variables "$@"
days="${days-10}"
human="${human-true}"
+output="${output-/dev/null}"
refs_prefix="${refs_prefix-refs/heads/linaro-local/ci/}"
refs_url_prefix="${refs_url_prefix-https://git.linaro.org/toolchain/ci}"
repos=("${repos[@]-default}")
@@ -19,6 +20,14 @@ only="${only-false}"
keep_tmp="${keep_tmp-false}"
tmpdir="${tmpdir-""}"
+if [ $output != "/dev/null" ]; then
+ rm -f $output
+fi
+
+# This represent the average number of days between the last commit
+# tested in the component, and the starting date of the jenkins test
+declare -A delay_per_component=([binutils]=0 [gcc]=0 [glibc]=0 [llvm]=0 [linux]=8 [qemu]=0)
+
process_manifest ()
{
components=$*
@@ -49,7 +58,7 @@ process_all_artifacts ()
local days_for_master days_for_release days_limit
# Initialize base-artifacts repo (by cloning its "empty" branch).
- clone_or_update_repo "base-artifacts" empty "$baseartifacts_url.git" >/dev/null 2>&1
+ clone_or_update_repo "base-artifacts" empty "$baseartifacts_url.git"
git -C "base-artifacts" reset -q --hard
days_for_master="$days"
@@ -64,8 +73,8 @@ process_all_artifacts ()
fi
dst_ref="refs/remotes/origin/${ref#refs/heads/}"
- git -C "base-artifacts" fetch -q origin "+$ref:$dst_ref" >/dev/null 2>&1
- git -C "base-artifacts" checkout FETCH_HEAD >/dev/null 2>&1
+ git -C "base-artifacts" fetch -q origin "+$ref:$dst_ref"
+ git -C "base-artifacts" checkout -q FETCH_HEAD
# -- get components for this project
components=""
@@ -75,7 +84,7 @@ process_all_artifacts ()
# 100fd17 round-robin.sh: Fix "git rev-parse" of short histories
commit_stamp=1660557250
days_ago=$((($(date +%s) - $commit_stamp) / (24 * 3600)))
- echo "all: ${ref#$refs_prefix}: No successful run since $days_ago days"
+ echo "all: ${ref#$refs_prefix}: No successful run since $days_ago days" |& tee -a $output
continue;
fi
while read -e c; do
@@ -101,11 +110,11 @@ process_all_artifacts ()
for c in $components; do
if [[ -v commit_stamps[$c] ]]; then
days_ago=$((($(date +%s) - ${commit_stamps[$c]}) / (24 * 3600)))
- if [ "$days_ago" -gt "$days_limit" ]; then
- echo "$c: ${ref#$refs_prefix}: last updated $days_ago days ago"
+ if [ "$days_ago" -gt "$((days_limit + delay_per_component[$c]))" ]; then
+ echo "$c: ${ref#$refs_prefix}: last updated $days_ago days ago" |& tee -a $output
fi
else
- echo "$c: ${ref#$refs_prefix}: no date for this component"
+ echo "$c: ${ref#$refs_prefix}: no date for this component" |& tee -a $output
fi
done
@@ -483,9 +492,9 @@ classify_failures ()
echo "working in $tmpdir"
cd $tmpdir
- printf "\n"
- printf "%-35s | %-13s | %-16s | %-16s | %-50s\n" "AUTOMATIC DIAGNOSTIC" "LAST UPDATED" "LAST POLLING" "LAST RUN" "PROJECT NAME"
- printf "====================================================================================================================================================================\n"
+ printf "\n" |& tee -a $output
+ printf "%-35s | %-13s | %-16s | %-16s | %-50s\n" "AUTOMATIC DIAGNOSTIC" "LAST UPDATED" "LAST POLLING" "LAST RUN" "PROJECT NAME" |& tee -a $output
+ printf "====================================================================================================================================================================\n" |& tee -a $output
while read -r line;
do
@@ -516,20 +525,20 @@ classify_failures ()
classify_analyse_result_file
classify_no_change_in_sources
- printf "%-35s | %-13s | %-16s | %-16s | %-16s %-50s\n" "${test['diag']}" "${test['last_updated']}" "${test['poll_date']}" "${test['run_date']}" "[${test['gitproject']}]" "$jenkins_base_url/job/${test['jkproject']}/${test['run_nb']}"
+ printf "%-35s | %-13s | %-16s | %-16s | %-16s %-50s\n" "${test['diag']}" "${test['last_updated']}" "${test['poll_date']}" "${test['run_date']}" "[${test['gitproject']}]" "$jenkins_base_url/job/${test['jkproject']}/${test['run_nb']}" |& tee -a $output
done < $stale_jobs_file
- printf "====================================================================================================================================================================\n"
- printf "SUMMARY : \n"
+ printf "====================================================================================================================================================================\n" |& tee -a $output
+ printf "SUMMARY : \n" |& tee -a $output
for K in "${!alldiags[@]}"; do
- printf " %-28s : %-3s\n" "$K" "${alldiags[$K]}"
+ printf " %-28s : %-3s\n" "$K" "${alldiags[$K]}" |& tee -a $output
done
- printf " %-28s : %-3s\n" "TOTAL FAILURES" "$count_all"
- printf "====================================================================================================================================================================\n"
- printf "SUGGESTIONS : \n"
- print_suggestions
- printf "====================================================================================================================================================================\n"
- printf "\n"
+ printf " %-28s : %-3s\n" "TOTAL FAILURES" "$count_all" |& tee -a $output
+ printf "====================================================================================================================================================================\n" |& tee -a $output
+ printf "SUGGESTIONS : \n" |& tee -a $output
+ print_suggestions |& tee -a $output
+ printf "====================================================================================================================================================================\n" |& tee -a $output
+ printf "\n" |& tee -a $output
[ $keep_tmp ] || rm -rf $tmpdir
}