aboutsummaryrefslogtreecommitdiff
path: root/jenkins/bisect.jpl
diff options
context:
space:
mode:
authorGuillaume Tucker <guillaume.tucker@collabora.com>2017-11-27 08:44:31 +0000
committerGuillaume Tucker <guillaume.tucker@collabora.com>2018-01-16 10:32:40 +0000
commit3ec4d959a088a4c107cf6200e571ada653417c4d (patch)
tree286f147c749a5f11c52092449de308c7630dfc27 /jenkins/bisect.jpl
parentaa918458dc8d8d3c58a36f3b603bd4693c6e4c4f (diff)
bisect.jpl: add stage to check passing boot
Add "Check pass" stage to build and boot test the git revision given as "good". This is to reduce the chances of false positives. Also move the git bisection start command to a separate "Start" stage. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'jenkins/bisect.jpl')
-rw-r--r--jenkins/bisect.jpl62
1 files changed, 57 insertions, 5 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl
index d950b97..293b2bc 100644
--- a/jenkins/bisect.jpl
+++ b/jenkins/bisect.jpl
@@ -56,6 +56,15 @@ def removeTag(kdir, tag) {
}
}
+def checkoutRevision(git_dir, git_rev) {
+ dir(git_dir) {
+ sh(script: """
+git clean -fd && \
+git checkout --detach ${git_rev}
+""")
+ }
+}
+
def cloneKCIBuild(kci_build) {
sh(script: "rm -rf ${kci_build}")
dir("${kci_build}") {
@@ -240,6 +249,7 @@ def bisectNext(kdir, status) {
node("bisection") {
def kci_build = env.WORKSPACE + '/kernelci-build'
def kdir = env.WORKSPACE + '/linux'
+ def check = null
echo """\
Lab: ${params.LAB}
@@ -257,25 +267,67 @@ Bad: ${params.BAD_COMMIT}"""
return
}
- def start_result = 0
-
timeout(time: 30, unit: 'MINUTES') {
stage("Init") {
parallel(
p1: { cloneKCIBuild(kci_build) },
p2: { cloneLinux(kdir) },
)
+ }
+ }
+
+ stage("Check pass") {
+ def tag = null
+
+ lock("${env.NODE_NAME}-build-lock") {
+ timeout(time: 60, unit: 'MINUTES') {
+ checkoutRevision(kdir, params.GOOD_COMMIT)
+ tag = createTag(kdir, 'pass')
+ try {
+ buildKernel(kdir, kci_build)
+ check = true
+ } catch (error) {
+ check = false
+ }
+ }
+ }
+
+ if (!check)
+ return
- start_result = bisectStart(kdir)
+ def describe = gitDescribe(kdir)
+
+ node("kernel-boot-v2") {
+ timeout(time: 120, unit: 'MINUTES') {
+ def lava_ci = env.WORKSPACE + '/lava-ci'
+ cloneLAVA_CI(lava_ci)
+ submitJob(lava_ci, describe)
+ def status = getResult(lava_ci)
+ check = (status == 0 ? true : false)
+ }
}
+
+ removeTag(kdir, tag)
}
- if (start_result) {
- echo "Failed to start bisection, commits range may be invalid."
+ if (!check) {
+ echo "Good revision check failed"
currentBuild.result = 'ABORTED'
return
}
+ timeout(time: 5, unit: 'MINUTES') {
+ stage("Start") {
+ def start_result = bisectStart(kdir)
+
+ if (start_result) {
+ echo "Failed to start bisection, commits range may be invalid."
+ currentBuild.result = 'ABORTED'
+ return
+ }
+ }
+ }
+
def previous = params.GOOD_COMMIT
def current = getSHA(kdir)
def iteration = 1