aboutsummaryrefslogtreecommitdiff
path: root/jenkins/bisect.jpl
diff options
context:
space:
mode:
authorGuillaume Tucker <guillaume.tucker@collabora.com>2017-11-29 14:45:10 +0000
committerGuillaume Tucker <guillaume.tucker@collabora.com>2018-01-16 10:32:40 +0000
commite1a93e5a254bb686815f6a7eff851dd4c45ebe86 (patch)
tree2101cc9f1f1148e7192ef6cf40b0ecafc122f0a7 /jenkins/bisect.jpl
parent14bfbe786e692990c5963ecc7bbdffa4fb398722 (diff)
bisect.jpl: refactor with runCheck()
Add runCheck() function to factor out the code for both the good and bad revision tests. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'jenkins/bisect.jpl')
-rw-r--r--jenkins/bisect.jpl91
1 files changed, 35 insertions, 56 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl
index f4f2f30..8c107a3 100644
--- a/jenkins/bisect.jpl
+++ b/jenkins/bisect.jpl
@@ -283,6 +283,39 @@ def bisectNext(kdir, status) {
* pipeline
*/
+def runCheck(kdir, kci_build, git_commit, name, run_status) {
+ def check = null
+ def tag = null
+
+ lock("${env.NODE_NAME}-build-lock") {
+ timeout(time: 60, unit: 'MINUTES') {
+ try {
+ tag = buildRevision(kdir, kci_build, git_commit, name)
+ check = true
+ } catch (error) {
+ check = false
+ }
+ }
+ }
+
+ if (!check)
+ return false
+
+ def describe = gitDescribe(kdir)
+
+ node("kernel-boot-v2") {
+ timeout(time: 120, unit: 'MINUTES') {
+ def lava_ci = env.WORKSPACE + '/lava-ci'
+ def status = runTest(lava_ci, describe)
+ check = (status == run_status ? true : false)
+ }
+ }
+
+ removeTag(kdir, tag)
+
+ return check
+}
+
node("bisection") {
def kci_build = env.WORKSPACE + '/kernelci-build'
def kdir = env.WORKSPACE + '/linux'
@@ -314,34 +347,7 @@ Bad: ${params.BAD_COMMIT}"""
}
stage("Check pass") {
- def tag = null
-
- lock("${env.NODE_NAME}-build-lock") {
- timeout(time: 60, unit: 'MINUTES') {
- try {
- tag = buildRevision(kdir, kci_build, params.GOOD_COMMIT,
- 'pass')
- check = true
- } catch (error) {
- check = false
- }
- }
- }
-
- if (!check)
- return
-
- def describe = gitDescribe(kdir)
-
- node("kernel-boot-v2") {
- timeout(time: 120, unit: 'MINUTES') {
- def lava_ci = env.WORKSPACE + '/lava-ci'
- def status = runTest(lava_ci, describe)
- check = (status == 0 ? true : false)
- }
- }
-
- removeTag(kdir, tag)
+ check = runCheck(kdir, kci_build, params.GOOD_COMMIT, 'pass', 0)
}
if (!check) {
@@ -351,34 +357,7 @@ Bad: ${params.BAD_COMMIT}"""
}
stage("Check fail") {
- def tag = null
-
- lock("${env.NODE_NAME}-build-lock") {
- timeout(time: 60, unit: 'MINUTES') {
- try {
- tag = buildRevision(kdir, kci_build, params.BAD_COMMIT,
- 'fail')
- check = true
- } catch (error) {
- check = false
- }
- }
- }
-
- if (!check)
- return
-
- def describe = gitDescribe(kdir)
-
- node("kernel-boot-v2") {
- timeout(time: 120, unit: 'MINUTES') {
- def lava_ci = env.WORKSPACE + '/lava-ci'
- def status = runTest(lava_ci, describe)
- check = (status == 2 ? true : false)
- }
- }
-
- removeTag(kdir, tag)
+ check = runCheck(kdir, kci_build, params.BAD_COMMIT, 'fail', 2)
}
if (!check) {