aboutsummaryrefslogtreecommitdiff
path: root/jenkins/bisect.jpl
diff options
context:
space:
mode:
authorGuillaume Tucker <guillaume.tucker@collabora.com>2018-01-22 15:17:22 +0000
committerGuillaume Tucker <guillaume.tucker@collabora.com>2018-02-23 09:46:08 +0000
commitce7b7f40435a07cdf5cba9df3318ba44c7d35d56 (patch)
treeef01aa4d20252ba65d56e7bb2d9a0642c0d4495a /jenkins/bisect.jpl
parenta8bb51ba4a21097641a3d8eb3006b0a42988483f (diff)
bisect.jpl: use webhook and lava-v2-callback.py
Use the Jenkins webhook plugin to directly receive LAVA v2 callback data and parse it with lava-v2-callback.py to determine whether the job passed or failed. Stop using lava-v2-get-boot-results.py as a result. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'jenkins/bisect.jpl')
-rw-r--r--jenkins/bisect.jpl40
1 files changed, 20 insertions, 20 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl
index f1dc20e..c85a4ee 100644
--- a/jenkins/bisect.jpl
+++ b/jenkins/bisect.jpl
@@ -220,7 +220,7 @@ def buildRevision(kdir, kci_build, git_rev, name) {
* kernel test with LAVA v2
*/
-def submitJob(lava_ci, describe) {
+def submitJob(lava_ci, describe, hook) {
dir(lava_ci) {
sh(script: "rm -rf data; mkdir data")
@@ -241,6 +241,9 @@ def submitJob(lava_ci, describe) {
--defconfig_full=${params.DEFCONFIG} \
--priority=${params.LAVA_PRIORITY} \
--callback=${params.LAVA_CALLBACK} \
+--callback-url=${hook.getURL()} \
+--callback-dataset=results \
+--callback-type=custom \
--targets=${params.TARGET}
""")
}
@@ -255,35 +258,31 @@ PYTHON_EGG_CACHE=${egg_cache} \
--username=kernel-ci \
--token=${SECRET} \
--lab=${params.LAB} \
---jobs=data \
---submitted=data/submitted.json
+--jobs=data
""")
}
-
- stash(name: "job-data", includes: "data/**")
}
}
-def getResult(lava_ci) {
- def status
+def getResult(lava_ci, hook) {
+ def status = null
dir(lava_ci) {
- sh(script: "rm -rf data")
- unstash("job-data")
- def egg_cache = eggCache()
- withCredentials([string(credentialsId: params.KCI_TOKEN_ID,
- variable: 'SECRET')]) {
+ echo "Waiting for job results..."
+ def data = waitForWebhook(hook)
+ def json_file = 'callback.json'
+ writeFile(file: json_file, text: data)
+ def token = "${params.LAB}-bisection-webhook"
+ withCredentials([string(credentialsId: token, variable: 'SECRET')]) {
+ def egg_cache = eggCache()
status = sh(returnStatus: true, script: """
PYTHON_EGG_CACHE=${egg_cache} \
-./lava-v2-get-boot-results.py \
---lab=${params.LAB} \
+./lava-v2-callback.py \
--token=${SECRET} \
---api=${params.KCI_API_URL} \
---submitted=data/submitted.json \
---period=30 \
---output=data/boots.json
+${json_file}
""")
}
+ sh(script: "rm -f ${json_file}")
}
return status
@@ -291,8 +290,9 @@ PYTHON_EGG_CACHE=${egg_cache} \
def runTest(lava_ci, describe) {
cloneLAVA_CI(lava_ci)
- submitJob(lava_ci, describe)
- return getResult(lava_ci)
+ def hook = registerWebhook()
+ submitJob(lava_ci, describe, hook)
+ return getResult(lava_ci, hook)
}
/* ----------------------------------------------------------------------------