diff options
author | Guillaume Tucker <guillaume.tucker@collabora.com> | 2018-01-15 11:49:39 +0000 |
---|---|---|
committer | Guillaume Tucker <guillaume.tucker@collabora.com> | 2018-02-19 12:12:53 +0000 |
commit | 9e6714b4c8199de1cae9a2dbec50c2434444695d (patch) | |
tree | dd24fbd1d5f2cb519b0b9c81f60349ad9fc34c7d /jenkins/bisect.jpl | |
parent | 89cd2fd1ecb6d4a8aa61e4ea0a2c0e2e46dad414 (diff) |
bisect.jpl: send email when bisection fails
In order to keep track of issues with the bisection jobs, send an
email whenever a job fails to run. This is not the same as aborting
on purpose due to an invalid bisection parameter or some other error
coming from the bisection itself.
Use the same EMAIL_RECIPIENTS parameter to define the recipients.
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'jenkins/bisect.jpl')
-rw-r--r-- | jenkins/bisect.jpl | 170 |
1 files changed, 95 insertions, 75 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl index 34d7699..774ae10 100644 --- a/jenkins/bisect.jpl +++ b/jenkins/bisect.jpl @@ -323,16 +323,18 @@ node("bisection") { def kdir = env.WORKSPACE + '/linux' def check = null + def params_summary = """\ + Tree: ${params.TREE} + URL: ${params.KERNEL_URL} + Branch: ${params.KERNEL_BRANCH} + Target: ${params.TARGET} + Lab: ${params.LAB} + Defconfig: ${params.DEFCONFIG} + Plan: ${params.PLAN}""" echo """\ -Lab: ${params.LAB} -Target: ${params.TARGET} -Tree: ${params.TREE} -URL: ${params.KERNEL_URL} -Branch: ${params.KERNEL_BRANCH} -Defconfig: ${params.DEFCONFIG} -Plan: ${params.PLAN} -Good: ${params.GOOD_COMMIT} -Bad: ${params.BAD_COMMIT}""" + Good: ${params.GOOD_COMMIT} + Bad: ${params.BAD_COMMIT} +${params_summary}""" if ((params.PLAN != 'boot') && (params.PLAN != 'simple')) { echo "Only doing boot and simple plans for now, aborting." @@ -340,93 +342,111 @@ Bad: ${params.BAD_COMMIT}""" return } - stage("Init") { - timeout(time: 30, unit: 'MINUTES') { - parallel( - p1: { cloneKCIBuild(kci_build) }, - p2: { cloneLinux(kdir) }, - ) + try { + stage("Init") { + timeout(time: 30, unit: 'MINUTES') { + parallel( + p1: { cloneKCIBuild(kci_build) }, + p2: { cloneLinux(kdir) }, + ) + } } - } - stage("Check pass") { - check = runCheck(kdir, kci_build, params.GOOD_COMMIT, 'pass', 0) - } - - if (!check) { - echo "Good revision check failed" - currentBuild.result = 'ABORTED' - return - } - - stage("Check fail") { - check = runCheck(kdir, kci_build, params.BAD_COMMIT, 'fail', 2) - } - - if (!check) { - echo "Bad revision check failed" - currentBuild.result = 'ABORTED' - return - } + stage("Check pass") { + check = runCheck(kdir, kci_build, params.GOOD_COMMIT, 'pass', 0) + } - stage("Start") { - timeout(time: 5, unit: 'MINUTES') { - check = bisectStart(kdir) + if (!check) { + echo "Good revision check failed" + currentBuild.result = 'ABORTED' + return } - } - if (!check) { - echo "Failed to start bisection, commits range may be invalid." - currentBuild.result = 'ABORTED' - return - } + stage("Check fail") { + check = runCheck(kdir, kci_build, params.BAD_COMMIT, 'fail', 2) + } - def previous = params.GOOD_COMMIT - def current = getSHA(kdir) - def iteration = 1 + if (!check) { + echo "Bad revision check failed" + currentBuild.result = 'ABORTED' + return + } - while (previous != current) { - def tag = createTag(kdir, iteration) - def status = null + stage("Start") { + timeout(time: 5, unit: 'MINUTES') { + check = bisectStart(kdir) + } + } - echo "Iteration #${iteration}: ${tag}" + if (!check) { + echo "Failed to start bisection, commits range may be invalid." + currentBuild.result = 'ABORTED' + return + } - lock("${env.NODE_NAME}-build-lock") { - stage("Build ${iteration}") { - timeout(time: 60, unit: 'MINUTES') { - try { - buildKernel(kdir, kci_build) - status = 0 - } catch (error) { - status = 1 + def previous = params.GOOD_COMMIT + def current = getSHA(kdir) + def iteration = 1 + + while (previous != current) { + def tag = createTag(kdir, iteration) + def status = null + + echo "Iteration #${iteration}: ${tag}" + + lock("${env.NODE_NAME}-build-lock") { + stage("Build ${iteration}") { + timeout(time: 60, unit: 'MINUTES') { + try { + buildKernel(kdir, kci_build) + status = 0 + } catch (error) { + status = 1 + } } } } - } - if (status == 0) { - def describe = gitDescribe(kdir) + if (status == 0) { + def describe = gitDescribe(kdir) - node("kernel-boot-v2") { - stage("Test ${iteration}") { - timeout(time: 120, unit: 'MINUTES') { - def lava_ci = env.WORKSPACE + '/lava-ci' - status = runTest(lava_ci, describe) + node("kernel-boot-v2") { + stage("Test ${iteration}") { + timeout(time: 120, unit: 'MINUTES') { + def lava_ci = env.WORKSPACE + '/lava-ci' + status = runTest(lava_ci, describe) + } } } } - } - removeTag(kdir, tag) + removeTag(kdir, tag) - stage("Next") { - timeout(time: 5, unit: 'MINUTES') { - bisectNext(kdir, status) + stage("Next") { + timeout(time: 5, unit: 'MINUTES') { + bisectNext(kdir, status) + } } + + previous = current + current = getSHA(kdir) + iteration += 1 } + } catch (err) { + currentBuild.result = "FAILURE" + + def tree_branch = "${params.TREE}/${params.KERNEL_BRANCH}" + def subject = "bisection error: #${env.BUILD_NUMBER} \ +${tree_branch} ${params.LAB} ${params.TARGET}" + def body = """\ +${env.BUILD_URL} + +${params_summary} + +${err} +""" + emailext(subject: subject, body: body, to: params.EMAIL_RECIPIENTS) - previous = current - current = getSHA(kdir) - iteration += 1 + throw err } } |