Jetty 12.0.x test launchable to detect flaky tests (#11983)

* test launchable

Signed-off-by: Olivier Lamy <olamy@apache.org>


---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
This commit is contained in:
Olivier Lamy 2024-07-12 12:01:32 +10:00 committed by GitHub
parent 1a43fbac7c
commit 7be30e0b15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 2 deletions

2
.gitignore vendored
View File

@ -52,3 +52,5 @@ bin/
# reports # reports
reports/ reports/
.launchable

23
Jenkinsfile vendored
View File

@ -9,6 +9,9 @@ pipeline {
buildDiscarder logRotator( numToKeepStr: '60' ) buildDiscarder logRotator( numToKeepStr: '60' )
disableRestartFromStage() disableRestartFromStage()
} }
environment {
LAUNCHABLE_TOKEN = credentials('launchable-token')
}
stages { stages {
stage("Parallel Stage") { stage("Parallel Stage") {
parallel { parallel {
@ -122,6 +125,8 @@ def mavenBuild(jdk, cmdline, mvnName) {
extraArgs = " -Dmaven.test.failure.ignore=true " 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" 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()) { if(saveHome()) {
archiveArtifacts artifacts: ".repository/org/eclipse/jetty/jetty-home/**/jetty-home-*", allowEmptyArchive: true, onlyIfSuccessful: false archiveArtifacts artifacts: ".repository/org/eclipse/jetty/jetty-home/**/jetty-home-*", allowEmptyArchive: true, onlyIfSuccessful: false
@ -132,6 +137,8 @@ def mavenBuild(jdk, cmdline, mvnName) {
finally finally
{ {
junit testResults: '**/target/surefire-reports/**/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true 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() { def websiteBuild() {
script { script {
try { try {
if ( env.BRANCH_NAME == 'jetty-10.0.x' || env.BRANCH_NAME == 'jetty-11.0.x' || env.BRANCH_NAME == 'jetty-12.0.x' ) { 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 ) build(job: 'website/jetty.website/main', propagate: false, wait: false)
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace() 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 // vim: et:ts=2:sw=2:ft=groovy