From 7be30e0b15ccd9262f35d0b7d62fbcd29cd80ba2 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 12 Jul 2024 12:01:32 +1000 Subject: [PATCH] Jetty 12.0.x test launchable to detect flaky tests (#11983) * test launchable Signed-off-by: Olivier Lamy --------- Signed-off-by: Olivier Lamy --- .gitignore | 2 ++ Jenkinsfile | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 918c60f7fc3..0c9c6a1c6f2 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,5 @@ bin/ # reports reports/ + +.launchable diff --git a/Jenkinsfile b/Jenkinsfile index 6ba853b7114..4c30e6f1bb6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,6 +9,9 @@ pipeline { buildDiscarder logRotator( numToKeepStr: '60' ) disableRestartFromStage() } + environment { + LAUNCHABLE_TOKEN = credentials('launchable-token') + } stages { stage("Parallel Stage") { parallel { @@ -122,6 +125,8 @@ def mavenBuild(jdk, cmdline, mvnName) { extraArgs = " -Dmaven.test.failure.ignore=true " } } + runLaunchable ("verify") + runLaunchable ("record build --name $BRANCH_NAME") sh "mvn $extraArgs -DsettingsPath=$GLOBAL_MVN_SETTINGS -Dmaven.repo.uri=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-public/ -ntp -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -U $cmdline" if(saveHome()) { archiveArtifacts artifacts: ".repository/org/eclipse/jetty/jetty-home/**/jetty-home-*", allowEmptyArchive: true, onlyIfSuccessful: false @@ -132,6 +137,8 @@ def mavenBuild(jdk, cmdline, mvnName) { finally { junit testResults: '**/target/surefire-reports/**/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true + echo "Launchable record tests" + runLaunchable ("record tests --build $BRANCH_NAME maven '**/target/surefire-reports/**/*.xml' '**/target/invoker-reports/TEST*.xml'") } } } @@ -160,8 +167,8 @@ def saveHome() { def websiteBuild() { script { try { - if ( env.BRANCH_NAME == 'jetty-10.0.x' || env.BRANCH_NAME == 'jetty-11.0.x' || env.BRANCH_NAME == 'jetty-12.0.x' ) { - build( job: 'website/jetty.website/main', propagate: false, wait: false ) + if (env.BRANCH_NAME == 'jetty-10.0.x' || env.BRANCH_NAME == 'jetty-11.0.x' || env.BRANCH_NAME == 'jetty-12.0.x') { + build(job: 'website/jetty.website/main', propagate: false, wait: false) } } catch (Exception e) { e.printStackTrace() @@ -169,5 +176,17 @@ def websiteBuild() { } } } +/** + * run launchable with args and ignore any errors + * @param args + */ +def runLaunchable(args) { + try { + sh "launchable $args" + } catch (Exception e) { + e.printStackTrace() + echo "skip failure running Launchable: " + e.getMessage() + } +} // vim: et:ts=2:sw=2:ft=groovy