diff options
author | Guillaume Tucker <guillaume.tucker@collabora.com> | 2018-02-07 14:05:55 +0000 |
---|---|---|
committer | Guillaume Tucker <guillaume.tucker@collabora.com> | 2018-02-23 09:46:08 +0000 |
commit | 650324ec1c7983ef22c46909720012025f4e9466 (patch) | |
tree | 6304425f57a41000c4781dcd7669d670e666138e /jenkins/bisect.jpl | |
parent | 994171355eda5820c54a5376f3e3c7d6a5de685a (diff) |
bisect.jpl: add verify and revert checks
Add checks at the end of a bisection job to verify that the found
"bad" commit is actually bad (i.e. fails to boot) and that reverting
it makes the kernel boot again. If the revert check fails, this
should only be treated as a warning as there may be several issues
within a given range of commits.
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'jenkins/bisect.jpl')
-rw-r--r-- | jenkins/bisect.jpl | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl index b9db66c..413311c 100644 --- a/jenkins/bisect.jpl +++ b/jenkins/bisect.jpl @@ -377,6 +377,15 @@ def runCheck(kdir, kci_build, git_commit, name, run_status) { return check } +def checkAbort(passed, message) { + if (!passed) { + echo message + currentBuild.result = 'ABORTED' + } + + return passed +} + node("bisection") { /* Global pipeline constants */ env._BUILD_JSON = "build-data.json" @@ -384,6 +393,7 @@ node("bisection") { def kci_build = env.WORKSPACE + '/kernelci-build' def kdir = env.WORKSPACE + '/linux' def check = null + def checks = [:] def params_summary = """\ Tree: ${params.KERNEL_TREE} @@ -417,34 +427,23 @@ ${params_summary}""" stage("Check pass") { check = runCheck(kdir, kci_build, params.GOOD_COMMIT, 'pass', 0) } - - if (!check) { - echo "Good revision check failed" - currentBuild.result = 'ABORTED' + if (!checkAbort(check, "Good revision check failed")) return - } stage("Check fail") { check = runCheck(kdir, kci_build, params.BAD_COMMIT, 'fail', 2) } - - if (!check) { - echo "Bad revision check failed" - currentBuild.result = 'ABORTED' + if (!checkAbort(check, "Bad revision check failed")) return - } stage("Start") { timeout(time: 5, unit: 'MINUTES') { check = bisectStart(kdir) } } - - if (!check) { - echo "Failed to start bisection, commits range may be invalid." - currentBuild.result = 'ABORTED' + if (!checkAbort(check, + "Failed to start bisection, commits range may be invalid.")) return - } def previous = params.GOOD_COMMIT def current = getSHA(kdir) @@ -494,6 +493,24 @@ ${params_summary}""" current = getSHA(kdir) iteration += 1 } + + stage("Verify") { + check = runCheck(kdir, kci_build, 'refs/bisect/bad', 'verify', 2) + checks['verify'] = check ? 'PASS' : 'FAIL' + } + if (!checkAbort(check, "Result check failed")) + return + + stage("Revert") { + dir(kdir) { + sh(script: "git revert refs/bisect/bad") + } + check = runCheck(kdir, kci_build, 'HEAD', 'revert', 0) + checks['revert'] = check ? 'PASS' : 'FAIL' + } + if (!check) + echo "Warning: revert check failed" + } catch (err) { currentBuild.result = "FAILURE" |