summaryrefslogtreecommitdiff
path: root/round-robin.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-12-13 08:48:14 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-12-13 09:50:26 +0000
commit6b3212ace88742231411a6baf453f6435a65502c (patch)
tree45879f9d150bd83f812551ce13956818112cd3b3 /round-robin.sh
parent83f95531c770b307cd2564d3f68be27b1fbf346e (diff)
round-robin.sh: Add "push" option to handling of base-artifacsts
... and baseline branches. Push results from current build (whatever they are, regressions are ignored) as new commit to base-artifacts, and update baseline branches. This is useful for user projects, e.g., to generate historical results for several toolchain versions. Change-Id: I3d700dcb31532003fd34eaec00d46b62982bb834
Diffstat (limited to 'round-robin.sh')
-rw-r--r--round-robin.sh41
1 files changed, 33 insertions, 8 deletions
diff --git a/round-robin.sh b/round-robin.sh
index 15a52641..363924e9 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -29,12 +29,16 @@ declare -gA rr
#rr[mode]="$mode"
# How to handle baseline:
+# - init: use "empty" results for base-artifacts, which will make current
+# build successful. Push our artifacts as the one and only entry.
# - update: update baseline branches of base-artifacts and components' repos
# on success (generate trigger files for bisection on failure).
# - reset: ignore failures in check_regression(), which will make current
# build successful. Push our artifacts to the top of base-artifacts/.
-# - init: use "empty" results for base-artifacts, which will make current
-# build successful. Push our artifacts as the one and only entry.
+# - push: push results from current build (whatever they are, regressions are
+# ignored) as new commit to base-artifacts, and update baseline
+# branches. This is useful for user projects, e.g., to generate
+# historical results for several toolchain versions.
# - rebase: treat results of this build as historically eldest, and
# rebase base-artifacts commits on top of this build's artifacts.
#rr[update_baseline]=update/reset/init/rebase
@@ -494,13 +498,26 @@ check_regression ()
local score
score=$(tail -n1 ${rr[top_artifacts]}/results)
- if [ x"${rr[update_baseline]}" = x"update" ]; then
+ if [ x"${rr[update_baseline]}" = x"update" \
+ -o x"${rr[update_baseline]}" = x"push" ]; then
${rr[no_regression_p]} base-artifacts ${rr[top_artifacts]} &
if wait $!; then
return
fi
local single_component=$(print_single_updated_component)
+ local trigger_dest
+
+ if [ x"${rr[update_baseline]}" = x"update" ]; then
+ # When "updating" baseline place trigger-* files at top level
+ # where jenkins expects them -- and trigger the followup builds.
+ trigger_dest="${rr[top_artifacts]}"
+ else
+ # We don't want to trigger follow up builds when "pushing"
+ # baseline. So, for the record, place trigger-* files in
+ # the step's artifacts directory.
+ trigger_dest="$run_step_artifacts"
+ fi
# 1. If $score is less-than 0, then the regression is uninteresting,
# don't bisect.
@@ -526,7 +543,7 @@ check_regression ()
else
echo "${c}_branch=baseline"
fi
- done > ${rr[top_artifacts]}/trigger-build-$update_components2
+ done > $trigger_dest/trigger-build-$update_components2
done < <(${rr[breakup_updated_components]})
else
# Bisect failures in all steps after "-1" step.
@@ -534,15 +551,21 @@ check_regression ()
baseline_rev=$(git_rev_parse_long $single_component ${rr[baseline_branch]} baseline)
cur_rev=$(git -C $single_component rev-parse HEAD)
- cat > ${rr[top_artifacts]}/trigger-bisect <<EOF
+ cat > $trigger_dest/trigger-bisect <<EOF
current_project=$single_component
baseline_branch=$baseline_rev
bad_branch=$cur_rev
EOF
fi
- # Fail.
- false
+ if [ x"${rr[update_baseline]}" = x"update" ]; then
+ # Fail.
+ false
+ else
+ # Compare results to generate logs and other artifacts,
+ # but we don't really care about regressions.
+ :
+ fi
elif [ x"${rr[update_baseline]}" = x"rebase" ]; then
local base_artifacts_head base_artifacts_tail
base_artifacts_head=$(git -C base-artifacts rev-parse HEAD)
@@ -569,7 +592,9 @@ update_baseline ()
local amend=""
local rebase_head rebase_tail
- if [ x"${rr[update_baseline]}" != x"rebase" ]; then
+ if [ x"${rr[update_baseline]}" = x"push" ]; then
+ :
+ elif [ x"${rr[update_baseline]}" != x"rebase" ]; then
local prev_head=""
# We discard baseline entries for results worse or same than