Skip to content

Commit

Permalink
[Build] Always archive artifacts in smoke-tests and use no main agent
Browse files Browse the repository at this point in the history
Always archiving artifacts help to debug failures.
Avoiding to use a 'main'-agent to just start all test-configurations
running on other machines saves precious resources in the Jenkins
instance while waiting for the tests to complete.

Additionally simplify post build result notifications.

Part of
eclipse-platform#2642
  • Loading branch information
HannesWell committed Dec 19, 2024
1 parent 6d29fcd commit 905eeba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 38 deletions.
2 changes: 0 additions & 2 deletions JenkinsJobs/SmokeTests/FOLDER.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ pipelineJob('SmokeTests/Start-smoke-tests'){
description('Build Id to test (such as I20240611-1800, N20120716-0800).')
trim(true)
}
}
parameters {
stringParam {
name('testsToRun')
defaultValue('ui')
Expand Down
46 changes: 10 additions & 36 deletions JenkinsJobs/SmokeTests/StartSmokeTests.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,7 @@ pipeline {
timestamps()
buildDiscarder(logRotator(numToKeepStr:'10'))
}
agent {
kubernetes { // a lean basic agent is sufficient.
inheritFrom 'basic' yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: "jnlp"
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
'''
}
}
agent none
stages {
stage('Trigger tests'){
matrix {
Expand Down Expand Up @@ -72,27 +55,15 @@ spec:
}
}
post {
aborted {
emailext body: "Smoke Tests failed. Please go to ${BUILD_URL} and check the build failure",
subject: "Smoke test for ${buildId} - ABORTED",
to: "[email protected] [email protected] [email protected]",
from:"[email protected]"
}
failure {
emailext body: "Smoke Tests failed. Please go to ${BUILD_URL} and check the build failure",
subject: "Smoke test for ${buildId} - FAILED",
to: "[email protected] [email protected] [email protected]",
from:"[email protected]"
}
unstable {
emailext body: "Smoke Tests failed. Please go to ${BUILD_URL} and check the test failures",
subject: "Smoke test for ${buildId} - UNSTABLE",
unsuccessful {
emailext subject: "Smoke test for ${buildId} - ${currentBuild.currentResult}",
body: "Smoke Tests failed. Please go to ${BUILD_URL} and check the build failure",
to: "[email protected] [email protected] [email protected]",
from:"[email protected]"
}
success {
emailext body: "Smoke Tests successful",
subject: "Smoke test for ${buildId} - SUCCESS",
emailext subject: "Smoke test for ${buildId} - SUCCESS",
body: "Smoke Tests successful: ${BUILD_URL}",
to: "[email protected] [email protected] [email protected]",
from:"[email protected]"
}
Expand All @@ -104,6 +75,7 @@ def runSmokeTest(Closure executorAgent, String agentId, String os, String arch,
cleanWs()
def javaHome = installJDK(javaVersion, os, arch)
def antHome = tool(type:'ant', name:'apache-ant-latest')
try {
dir ("${WORKSPACE}/${agentId}-java${javaVersion}") { // run in a unique directory to allow distinction of archived build artifacts
withEnv([
"JAVA_HOME=${javaHome}", "ANT_HOME=${ antHome }",
Expand Down Expand Up @@ -154,8 +126,10 @@ def runSmokeTest(Closure executorAgent, String agentId, String os, String arch,
}
}
}
archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, */*.properties, */*.txt'
junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml'
} finally {
archiveArtifacts allowEmptyArchive: true, artifacts: '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, */*.properties, */*.txt'
}
})
}

Expand Down

0 comments on commit 905eeba

Please sign in to comment.