Skip to content

Commit ea1801e

Browse files
committed
[I/Y-Build] Streamline and parallelize collection of test result
Transfer the test results directly from the individual test-build Jenkins agents to the storage server upon completion and stop archiving the result files in the jobs. In the 'collectTestResults' job only regenerate the test-result overview page and don't handle the result file transfer anymore. Consequently rename the job to just 'updateTestResultIndex'.
1 parent eca0b8b commit ea1801e

File tree

3 files changed

+33
-36
lines changed

3 files changed

+33
-36
lines changed

JenkinsJobs/AutomatedTests/integrationTests.jenkinsfile

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pipeline {
1010
parameters {
1111
string(name: 'buildId', trim: true, description: 'Build Id to test. For example: <code>I20251010-0150</code>')
1212
string(name: 'testSuite', defaultValue: 'all', trim: true, description: '''This can be any ant target from
13-
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/master/production/testScripts/configuration/sdk.tests/testScripts/test.xml
13+
the <a href="https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/master/production/testScripts/configuration/sdk.tests/testScripts/test.xml"><code>test.xml</code></a>
1414
''')
1515
string(name: 'testAgent', trim: true, description: '''The Jenkins build agent this test should run on. If not specified to will be read from the
1616
<a href="https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/master/JenkinsJobs/buildConfigurations.json"><code>buildConfigurations.json</code></a>
@@ -42,6 +42,8 @@ pipeline {
4242
label "${ params.testAgent ?: TEST_AGENT }"
4343
}
4444
environment {
45+
// Download Server locations (seldomly change)
46+
EP_ECLIPSE_DROPS = '/home/data/httpd/download.eclipse.org/eclipse/downloads/drops4'
4547
// Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh
4648
ANT_HOME = tool(type:'ant', name:'apache-ant-latest')
4749
ANT_OPTS = "-Djava.io.tmpdir=${pathOf(env.WORKSPACE + '/tmp')}"
@@ -83,22 +85,43 @@ pipeline {
8385
echo JAVA_HOME: §[JAVA_HOME]
8486
echo ANT_HOME: §[ANT_HOME]
8587
echo PATH: §[PATH]
86-
java -XshowSettings -version 1>javaSettings.txt 2>&1
88+
java -XshowSettings -version
8789

8890
curl --fail --output getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml
8991
ant -f getEBuilder.xml -DbuildId=${params.buildId} -Dosgi.os=${test.os} -Dosgi.ws=${test.ws} -Dosgi.arch=${test.arch} -DtestSuite=${params.testSuite}
9092
""")
9193
}
92-
archiveArtifacts '**/eclipse-testing/results/**, *.properties, *.txt'
9394
junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml'
94-
build job: 'Releng/collectTestResults', wait: false, parameters: [
95-
string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"),
96-
string(name: 'buildURL', value: "${BUILD_URL}"),
97-
string(name: 'buildID', value: "${params.buildId}")
98-
]
9995
}
10096
post {
10197
always {
98+
script {
99+
if (currentBuild.result != 'ABORTED') {
100+
// Transfer test results to storage-server (skip for partial results on aborted run)
101+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
102+
sh '''#!/bin/bash -xe
103+
remoteResultsDirectory="${EP_ECLIPSE_DROPS}/${buildId}/testresults"
104+
localResultsDirectory="workarea/${buildId}/eclipse-testing/results"
105+
ssh [email protected] mkdir -p ${remoteResultsDirectory}
106+
if [ -d "${localResultsDirectory}/xml" ] && [ -z "$(find ${localResultsDirectory}/xml -maxdepth 0 -empty)" ]; then
107+
# First delete result files from a previous run of the same configuration (in case that test configuration was run again), then transfer the new results.
108+
ssh [email protected] rm -rfv ${remoteResultsDirectory}/${JOB_BASE_NAME}* ${remoteResultsDirectory}/*/*${JOB_BASE_NAME}*
109+
scp -r ${localResultsDirectory}/* [email protected]:${remoteResultsDirectory}
110+
# Download the result summary directly to the storage server
111+
112+
curl --fail --location --output "${remoteResultsDirectory}/${JOB_BASE_NAME}.xml" "${BUILD_URL}/testReport/api/xml?tree=failCount,passCount,skipCount,duration"
113+
fi
114+
'''
115+
}
116+
}
117+
if (currentBuild.result == 'SUCCESS' || currentBuild.result == 'UNSTABLE') {
118+
build job: 'Releng/updateTestResultIndex', wait: false, parameters: [
119+
string(name: 'buildID', value: "${params.buildId}")
120+
]
121+
}
122+
}
123+
}
124+
cleanup {
102125
cleanWs()
103126
}
104127
}

JenkinsJobs/Releng/collectTestResults.jenkinsfile renamed to JenkinsJobs/Releng/updateTestResultIndex.jenkinsfile

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ pipeline {
1010
disableConcurrentBuilds()
1111
}
1212
parameters {
13-
string(name: 'triggeringJob', trim: true, description: 'Name of the job to collect results from: i.e. \'ep427I-unit-cen64-gtk3-java17\'.')
14-
string(name: 'buildURL', trim: true, description: 'Build URL of the triggering job.')
1513
string(name: 'buildID', trim: true, description: 'ID of the I-build being tested.')
1614
}
1715
agent {
@@ -55,36 +53,14 @@ pipeline {
5553
testResultsDir="${buildDirectory}/testresults"
5654
mkdir -p "${testResultsDir}"
5755

58-
# ==========================================
59-
# Collect results and overview from test-job
60-
pushd "${testResultsDir}"
61-
62-
curl -L -o "${triggeringJob}.xml" "${buildURL}/testReport/api/xml?tree=failCount,passCount,skipCount,duration"
63-
curl -L -o results.zip "${buildURL}/artifact/workarea/${buildID}/eclipse-testing/results/*zip*/results.zip"
64-
unzip results.zip
65-
# copy them to the expected location (from the subfolder of the zip) and remove all download artifacts.
66-
mv results/* .
67-
rm -rf results results.zip
68-
popd
69-
70-
# Fetch previously collected test results and already generated files (that would otherwise be re-generated)
71-
allTestResultsDirectory="${EP_ECLIPSE_DROPS}/${buildID}/testresults"
72-
if ssh [email protected] "[ -d '${allTestResultsDirectory}/xml' ]"; then
73-
# First delete result files from a previous run of the same configuration (in case that test configuration was run again).
74-
ssh [email protected] rm -rfv ${allTestResultsDirectory}/${triggeringJob}* ${allTestResultsDirectory}/*/*${triggeringJob}*
75-
rsync -avzh [email protected]:${allTestResultsDirectory}/xml ${buildDirectory}/testresults
76-
else
77-
echo 'Test results of other configurations not yet published.'
78-
fi
56+
# Fetch previously collected test results of all completed runs
57+
rsync -avzh [email protected]:${EP_ECLIPSE_DROPS}/${buildID}/testresults/xml ${testResultsDir}
7958

8059
#triggering ant runner
81-
devworkspace=${WORKSPACE}/workspace-updateTestResults
82-
8360
$ECLIPSE -debug -data ${WORKSPACE}/workspace-updateTestResults \
8461
-application org.eclipse.ant.core.antRunner \
8562
-file "${WORKSPACE}/git-repo/cje-production/scripts/publish.xml" \
8663
-DbuildDirectory=${buildDirectory} \
87-
-Djob=${triggeringJob} \
8864
-DbuildType=${BUILD_TYPE} \
8965
"-DtestsConfigExpected=${TEST_CONFIGURATIONS_EXPECTED}" \
9066
"-DmanifestFile=${WORKSPACE}/git-repo/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/testManifest.xml"

cje-production/scripts/publish.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<taskdef name="indexResults" classname="${class}" />
2626

2727
<echo message=" = = properties in publish.xml == " />
28-
<echo message=" job: ${job}" />
2928
<echo message=" isBuildTested: ${isBuildTested}" />
3029
<echo message=" buildType: ${buildType}" />
3130
<echo message=" dropTokenList: ${dropTokenList}" />
@@ -63,7 +62,6 @@
6362

6463
<target name="initResultsVariables">
6564
<fail unless="buildDirectory" />
66-
<fail unless="job" />
6765
<fail unless="buildType" />
6866
<fail unless="testsConfigExpected" />
6967
<fail unless="manifestFile" />

0 commit comments

Comments
 (0)