diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-09-09 10:25:40 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-09-09 10:25:40 +0000 |
commit | 39a8c5a172cc879fce5395a960137190e7f0114a (patch) | |
tree | 719134aea9f05fdb553c1ce2d589a932b93fc8ed | |
parent | 8761363ce29560e319e42cd6c3a6140343e29852 (diff) |
round-robin.sh: NFC, cleanup
Change-Id: I1e8bfb11f1d7a1c51fe1827d4068d7d9ea423f6c
-rw-r--r-- | round-robin.sh | 146 | ||||
-rwxr-xr-x | tcwg_bmk-build.sh | 3 |
2 files changed, 75 insertions, 74 deletions
diff --git a/round-robin.sh b/round-robin.sh index afc1e23e..f83cc8f7 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -585,7 +585,7 @@ check_regression () if [ x"$score" = x"-$EXTERNAL_FAIL" ]; then echo "ERROR: We have encountered some infrastructure problem (e.g.," - echo " benchmarking boards are offline), andso we can't finish" + echo " benchmarking boards are offline), and we can't finish" echo " the build." # Exit now and don't update baseline artifacts. # By not creating trigger-build-* files, we signal @@ -593,87 +593,85 @@ check_regression () exit $EXTERNAL_FAIL fi - if true; then - # Generate comparison artifacts for update, reset, init and push modes. - ${rr[no_regression_p]} base-artifacts ${rr[top_artifacts]} & - if wait $!; then - # All good, no regression - return - fi + # Generate comparison artifacts for update, reset, init and push modes. + ${rr[no_regression_p]} base-artifacts ${rr[top_artifacts]} & + if wait $!; then + # All good, no regression + return + fi - if [ -f $run_step_artifacts/results.regressions ]; then - # Add regression info generated by no_regression_p to top-level - # results file. - cat $run_step_artifacts/results.regressions \ - >> ${rr[top_artifacts]}/results - fi + if [ -f $run_step_artifacts/results.regressions ]; then + # Add regression info generated by no_regression_p to top-level + # results file. + cat $run_step_artifacts/results.regressions \ + >> ${rr[top_artifacts]}/results + fi - # We've got a regression. Generate trigger-* files. - local single_component - 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 + # We've got a regression. Generate trigger-* files. + local single_component + single_component=$(print_single_updated_component) + local trigger_dest - # 1. If $score is less-than 0, then the regression is not very - # interesting, so reduce down to component, but don't bisect. This - # allows non-broken components to advance their revisions. - # 2. Otherwise, trigger builds with narrowed-down list of updated - # components -- by generating trigger-build-* files. Also generate - # these files as a favor to round-robin-bisect.sh script. - # 3. Otherwise, we have narrowed-down regression to a single component, - # so trigger bisect build for this component -- by generating - # trigger-bisect file. Note that the negative "! [ $score -lt 0 ]" - # condition is to handle non-numeric scores like "all" and "boot". - if [ $score -lt 0 ] 2>/dev/null && [ x"${rr[mode]}" = x"bisect" ]; then - # Don't bisect uninteresting regressions. - : - elif [ x"$single_component" = x"" ] || [ x"${rr[mode]}" = x"bisect" ]; then - local -a update_components - - while read -a update_components; do - local c update_components2 - update_components2=$(echo "${update_components[@]}" | tr ' ' '-') - - for c in ${rr[components]}; do - if echo "${update_components[@]}" | tr ' ' '\n' | grep -q "^$c\$"; then - echo "${c}_git=${rr[${c}_git]}" - else - echo "${c}_git=baseline" - fi - done > $trigger_dest/trigger-build-$update_components2 - done < <(${rr[breakup_updated_components]}) - elif ! [ $score -lt 0 ] 2>/dev/null; then - # Bisect failures in all steps after "-1" step. - local cur_rev - cur_rev=$(git -C $single_component rev-parse HEAD) - - cat > $trigger_dest/trigger-bisect <<EOF + 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 not very + # interesting, so reduce down to component, but don't bisect. This + # allows non-broken components to advance their revisions. + # 2. Otherwise, trigger builds with narrowed-down list of updated + # components -- by generating trigger-build-* files. Also generate + # these files as a favor to round-robin-bisect.sh script. + # 3. Otherwise, we have narrowed-down regression to a single component, + # so trigger bisect build for this component -- by generating + # trigger-bisect file. Note that the negative "! [ $score -lt 0 ]" + # condition is to handle non-numeric scores like "all" and "boot". + if [ $score -lt 0 ] 2>/dev/null && [ x"${rr[mode]}" = x"bisect" ]; then + # Don't bisect uninteresting regressions. + : + elif [ x"$single_component" = x"" ] || [ x"${rr[mode]}" = x"bisect" ]; then + local -a update_components + + while read -a update_components; do + local c update_components2 + update_components2=$(echo "${update_components[@]}" | tr ' ' '-') + + for c in ${rr[components]}; do + if echo "${update_components[@]}" | tr ' ' '\n' | grep -q "^$c\$"; then + echo "${c}_git=${rr[${c}_git]}" + else + echo "${c}_git=baseline" + fi + done > $trigger_dest/trigger-build-$update_components2 + done < <(${rr[breakup_updated_components]}) + elif ! [ $score -lt 0 ] 2>/dev/null; then + # Bisect failures in all steps after "-1" step. + local cur_rev + cur_rev=$(git -C $single_component rev-parse HEAD) + + cat > $trigger_dest/trigger-bisect <<EOF current_project=$single_component bad_git=${rr[${single_component}_git]%#*}#$cur_rev EOF - if [ -f $run_step_artifacts/extra-bisect-params ]; then - cat $run_step_artifacts/extra-bisect-params >> $trigger_dest/trigger-bisect - fi + if [ -f $run_step_artifacts/extra-bisect-params ]; then + cat $run_step_artifacts/extra-bisect-params >> $trigger_dest/trigger-bisect fi + fi - if [ x"${rr[update_baseline]}" = x"update" ]; then - echo "Detected a regression in \"update\" mode!" - false - else - # Compare results to generate logs and other artifacts, - # but we don't really care about regressions. - : - fi + if [ x"${rr[update_baseline]}" = x"update" ]; then + echo "Detected a regression in \"update\" mode!" + false + else + # Compare results to generate logs and other artifacts, + # but we don't really care about regressions. + : fi ) } diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh index 925c6836..d2dcb29e 100755 --- a/tcwg_bmk-build.sh +++ b/tcwg_bmk-build.sh @@ -600,6 +600,9 @@ no_regression_to_base_p () # Make sure there is no stray results.regression file, which we use # as failure marker. + # We can, potentially, call ${rr[no_regression_p]} several times in + # a row during update_baseline() step, but we should stop at the first + # regression. Therefore, we should never see results.regressions exist. assert ! [ -f $run_step_artifacts/results.regressions ] local compare_opts="" |