diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-01-20 10:44:14 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-01-22 13:40:55 +0000 |
commit | 8332f727f78dc530228b9348eea626f8bdc1aa45 (patch) | |
tree | 1fea28950c05d710b8c1b8f098d427c98651c2ea | |
parent | cb9f3c0be4f69e25b172b3591477d4cddf5adb2b (diff) |
tcwg_kernel-bisect: Generalize bisect script for use in tcwg_bmk project
Add $ci_project and $ci_config parameters to replace references to
tcwg_kernel-specific variables.
Note that linux-next rebase workaround doesn't depend on specifics
of tcwg_kernel project, and would work just fine in other CI
projects, if necessary.
Change-Id: I81e637126bf0622ee1b67e05974c08fc51c313dd
-rwxr-xr-x | tcwg_kernel-bisect.sh | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index 9bfe6eaf..a235b026 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -13,6 +13,8 @@ fresh_dir $artifacts "$artifacts/manifests/*" "$artifacts/jenkins/*" convert_args_to_variables "$@" shift "$SHIFT_CONVERTED_ARGS" +obligatory_variables bad_rev baseline_rev build_script ci_project ci_config + BUILD_URL="${BUILD_URL:-$(pwd)}" reproduce_bisect="${reproduce_bisect:-false}" @@ -20,10 +22,12 @@ reproduce_bisect="${reproduce_bisect:-false}" convert_args_to_variables ^^ $reproduce_bisect %% $artifacts/manifests/build-parameters.sh "$@" $reproduce_bisect || manifest_pop -obligatory_variables bad_rev baseline_rev current_project toolchain +obligatory_variables current_project + +if [ x"$ci_project" = x"tcwg_kernel" ]; then + obligatory_variables toolchain +fi -linux_config="${linux_config:-defconfig}" -target="${target:-native}" verbose="${verbose:-true}" set -u @@ -35,7 +39,7 @@ trap "eval \"echo ERROR at \${FUNCNAME[0]}:\${BASH_LINENO[0]}\" > $artifacts/fai # Build baseline that we are going to re-use to speed-up bisection. # (This also confirms that infrastructure is OK.) echo "Testing baseline_rev $baseline_rev (should be success)" -$scripts/tcwg_kernel-build.sh \ +$build_script \ ^^ $reproduce_bisect \ %% $artifacts/manifests/build-baseline.sh \ @@ $artifacts/manifests/build-parameters.sh \ @@ -86,7 +90,7 @@ cat > $artifacts/test.sh <<EOF #!/bin/sh rev=\$(git rev-parse HEAD) cd .. -$scripts/tcwg_kernel-build.sh \ +$build_script \ ^^ $reproduce_bisect \ %% $artifacts/manifests/build-\$rev.sh \ @@ $artifacts/manifests/build-parameters.sh \ @@ -261,7 +265,7 @@ if [ -f $artifacts/first-bad ]; then ln -f -s "build-$last_good.sh" "$artifacts/manifests/build-last_good.sh" cat >> $artifacts/jenkins/mail-body.txt <<EOF -Successfully identified regression in $current_project on $target @ $toolchain-${rr[${toolchain}_version]} @ linux-${rr[linux_version]}-$linux_config between bad $bad_rev and baseline $baseline_rev . +Successfully identified regression in CI configuration $ci_config for $current_project between bad_rev $bad_rev and baseline_rev $baseline_rev . Culprit: <cut> @@ -275,7 +279,7 @@ else bad_name="bad" bad_sha1="$bad_rev" cat >> $artifacts/jenkins/mail-body.txt <<EOF -Could not identify regression in $current_project on $target @ $toolchain-${rr[${toolchain}_version]} @ linux-${rr[linux_version]}-$linux_config between bad $bad_rev and baseline $baseline_rev down to a single commit. See 'Bisect log' in the links below for bisection details. +Could not identify regression in CI configuration $ci_config for $current_project between bad_rev $bad_rev and baseline_rev $baseline_rev down to a single commit. See 'Bisect log' in the links below for bisection details. EOF fi @@ -302,7 +306,7 @@ mkdir investigate-$current_project-$bad_sha1 cd investigate-$current_project-$bad_sha1 git clone https://git.linaro.org/toolchain/jenkins-scripts wget ${BUILD_URL}artifact/artifacts/manifests/build-baseline.sh -./jenkins-scripts/tcwg_kernel-build.sh @@ build-$baseline.sh +$build_script @@ build-baseline.sh wget ${BUILD_URL}artifact/artifacts/test.sh chmod +x test.sh cd $current_project @@ -315,7 +319,7 @@ git checkout --detach $good_sha1 cd .. </cut> -History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/ci/tcwg_kernel/$toolchain-${rr[${toolchain}_version]}-$target-${rr[linux_version]}-$linux_config +History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/ci/$ci_project/$ci_config Bisect log: ${BUILD_URL}artifact/artifacts/bisect.log/*view*/ Artifacts: ${BUILD_URL}artifact/artifacts/ @@ -333,14 +337,16 @@ $(git -C $current_project show $first_bad) EOF fi -# Set mail recipients last to preserve catch-error value from tcwg_kernel.yaml. +# Set mail recipients last to preserve catch-error value from .yaml file. # Email developers. CI_MAIL_RECIPIENTS="tcwg-validation@linaro.org" -case "$toolchain:$current_project" in - gnu:*) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, christophe.lyon@linaro.org, maxim.kuvyrkov@linaro.org" ;; - llvm:linux) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, arnd@linaro.org, mark.brown@linaro.org, ndesaulniers@google.com, trong@google.com" ;; - llvm:llvm) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, adhemerval.zanella@linaro.org, maxim.kuvyrkov@linaro.org, ndesaulniers@google.com, trong@google.com, yvan.roux@linaro.org" ;; -esac +if [ x"$ci_project" = x"tcwg_kernel" ]; then + case "$toolchain:$current_project" in + gnu:*) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, christophe.lyon@linaro.org, maxim.kuvyrkov@linaro.org" ;; + llvm:linux) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, arnd@linaro.org, mark.brown@linaro.org, ndesaulniers@google.com, trong@google.com" ;; + llvm:llvm) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, adhemerval.zanella@linaro.org, maxim.kuvyrkov@linaro.org, ndesaulniers@google.com, trong@google.com, yvan.roux@linaro.org" ;; + esac +fi cat > $artifacts/jenkins/mail-recipients.txt <<EOF $CI_MAIL_RECIPIENTS EOF |