Skip to content

Commit 9e04f87

Browse files
committed
[I-Build-Tests] Clean-up and unify test launch scripts and ant setup
- Use curl instead of wget (the former seems to be available on more machines by default) - Remove unnecessary time measurements and whitespace in print-out - Unify variable definition and created environment files - Unify consideration of ANT_OPTS environment variable - Remove secondary tee-ing of console print-out in Linux logs to not defined path variable ${consolelogs}
1 parent 1e918af commit 9e04f87

File tree

8 files changed

+58
-78
lines changed

8 files changed

+58
-78
lines changed

JenkinsJobs/AutomatedTests/I_unit_linux.groovy

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,59 +88,46 @@ spec:
8888
JAVA_HOME = tool(type:'jdk', name:'openjdk-jdk''' + JAVA_VERSION + '''-latest')
8989
ANT_HOME = tool(type:'ant', name:'apache-ant-latest')
9090
PATH = "${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}"
91+
ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}/tmp -Djava.security.manager=allow"
9192
}
9293
steps {
9394
container ('custom'){
9495
xvnc(useXauthority: true) {
9596
sh \'\'\'#!/bin/bash -x
9697
9798
buildId=$(echo $buildId|tr -d ' ')
98-
RAW_DATE_START="$(date +%s )"
99-
10099
export LANG=en_US.UTF-8
101100
cat /etc/*release
102-
echo -e "\\n\\tRAW Date Start: ${RAW_DATE_START} \\n"
103-
echo -e "\\n\\t whoami: $( whoami )\\n"
104-
echo -e "\\n\\t uname -a: $(uname -a)\\n"
101+
echo "whoami: $(whoami)"
102+
echo "uname -a: $(uname -a)"
105103
106104
# 0002 is often the default for shell users, but it is not when ran from
107105
# a cron job, so we set it explicitly, to be sure of value, so releng group has write access to anything
108106
# we create on shared area.
109107
oldumask=$(umask)
110108
umask 0002
111-
112109
echo "umask explicitly set to 0002, old value was $oldumask"
113110
114111
# we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it.
115-
mkdir -p ${WORKSPACE}/tmp
112+
mkdir -p tmp
116113
117-
wget -O ${WORKSPACE}/getEBuilder.xml --no-verbose --no-check-certificate https://download.eclipse.org/eclipse/relengScripts/production/testScripts/hudsonBootstrap/getEBuilder.xml 2>&1
118-
wget -O ${WORKSPACE}/buildproperties.shsource --no-check-certificate https://download.eclipse.org/eclipse/downloads/drops4/${buildId}/buildproperties.shsource
119-
cat ${WORKSPACE}/buildproperties.shsource
120-
source ${WORKSPACE}/buildproperties.shsource
114+
curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/production/testScripts/hudsonBootstrap/getEBuilder.xml
115+
curl -o buildproperties.shsource https://download.eclipse.org/eclipse/downloads/drops4/${buildId}/buildproperties.shsource
116+
source buildproperties.shsource
121117
122118
echo JAVA_HOME: $JAVA_HOME
123119
echo ANT_HOME: $ANT_HOME
124120
echo PATH: $PATH
125-
export ANT_OPTS="${ANT_OPTS} -Djava.io.tmpdir=${WORKSPACE}/tmp -Djava.security.manager=allow"
126121
127122
env 1>envVars.txt 2>&1
128123
ant -diagnostics 1>antDiagnostics.txt 2>&1
129124
java -XshowSettings -version 1>javaSettings.txt 2>&1
130125
131-
ant -f getEBuilder.xml -Djava.io.tmpdir=${WORKSPACE}/tmp -DbuildId=$buildId -DeclipseStream=$STREAM -DEBUILDER_HASH=${EBUILDER_HASH} \\
126+
ant -f getEBuilder.xml -DbuildId=${buildId} -DeclipseStream=${STREAM} -DEBUILDER_HASH=${EBUILDER_HASH} \\
132127
-DdownloadURL=https://download.eclipse.org/eclipse/downloads/drops4/${buildId} \\
133128
-Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 \\
134-
-DtestSuite=all \\
135-
-Djvm=${JAVA_HOME}/bin/java
136-
137-
RAW_DATE_END="$(date +%s )"
138-
139-
echo -e "\\n\\tRAW Date End: ${RAW_DATE_END} \\n"
140-
141-
TOTAL_TIME=$((${RAW_DATE_END} - ${RAW_DATE_START}))
142-
143-
echo -e "\\n\\tTotal elapsed time: ${TOTAL_TIME} \\n"
129+
-DtestSuite=all
130+
# For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903
144131
\'\'\'
145132
}
146133
}

JenkinsJobs/AutomatedTests/I_unit_mac.groovy

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,16 @@ pipeline {
3535
environment {
3636
// 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
3737
JAVA_HOME = \'''' + ARCHS_JAVA_HOME[ARCH] + ''''
38-
ANT_HOME = '/opt/homebrew/Cellar/ant/1.10.11/libexec'
38+
ANT_HOME = tool(type:'ant', name:'apache-ant-latest')
3939
PATH = "${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}"
40+
ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}/tmp -Djava.security.manager=allow"
4041
eclipseArch = \'''' + ARCH + ''''
4142
}
4243
steps {
4344
cleanWs() // workspace not cleaned by default
4445
sh \'\'\'#!/bin/bash -x
45-
RAW_DATE_START="$(date +%s )"
46-
47-
echo -e "\\n\\tRAW Date Start: ${RAW_DATE_START} \\n"
48-
49-
echo -e "\\n\\t whoami: $( whoami )\\n"
50-
echo -e "\\n\\t uname -a: $(uname -a)\\n"
46+
echo " whoami: $(whoami)"
47+
echo " uname -a: $(uname -a)"
5148
5249
# unset commonly defined system variables, which we either do not need, or want to set ourselves.
5350
# (this is to improve consistency running on one machine versus another)
@@ -64,32 +61,23 @@ echo "umask explicitly set to 0002, old value was $oldumask"
6461
# we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it.
6562
mkdir -p tmp
6663
67-
curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/production/testScripts/hudsonBootstrap/getEBuilder.xml 2>&1
68-
cat getEBuilder.xml
69-
curl -o buildProperties.sh https://download.eclipse.org/eclipse/downloads/drops4/$buildId/buildproperties.shsource
70-
cat getEBuilder.xml
71-
source buildProperties.sh
64+
curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/production/testScripts/hudsonBootstrap/getEBuilder.xml
65+
curl -o buildproperties.shsource https://download.eclipse.org/eclipse/downloads/drops4/${buildId}/buildproperties.shsource
66+
source buildproperties.shsource
7267
7368
echo JAVA_HOME: $JAVA_HOME
7469
echo ANT_HOME: $ANT_HOME
7570
echo PATH: $PATH
7671
77-
env 1>envVars.txt 2>&1
78-
ant -diagnostics 1>antDiagnostics.txt 2>&1
79-
java -XshowSettings -version 1>javaSettings.txt 2>&1
72+
env 1>envVars.txt 2>&1
73+
ant -diagnostics 1>antDiagnostics.txt 2>&1
74+
java -XshowSettings -version 1>javaSettings.txt 2>&1
8075
81-
ant -f getEBuilder.xml -Djava.io.tmpdir=${WORKSPACE}/tmp -DbuildId=$buildId -DeclipseStream=$STREAM -DEBUILDER_HASH=${EBUILDER_HASH} \\
76+
ant -f getEBuilder.xml -DbuildId=${buildId} -DeclipseStream=${STREAM} -DEBUILDER_HASH=${EBUILDER_HASH} \\
8277
-DdownloadURL=https://download.eclipse.org/eclipse/downloads/drops4/${buildId} \\
8378
-Dosgi.os=macosx -Dosgi.ws=cocoa -Dosgi.arch=${eclipseArch} \\
8479
-DtestSuite=all
85-
86-
RAW_DATE_END="$(date +%s )"
87-
88-
echo -e "\\n\\tRAW Date End: ${RAW_DATE_END} \\n"
89-
90-
TOTAL_TIME=$((${RAW_DATE_END} - ${RAW_DATE_START}))
91-
92-
echo -e "\\n\\tTotal elapsed time: ${TOTAL_TIME} \\n"
80+
# For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903
9381
\'\'\'
9482
archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt'
9583
junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml'

JenkinsJobs/AutomatedTests/I_unit_win32.groovy

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,45 @@ pipeline {
2929
stage('Run tests'){
3030
environment {
3131
// 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
32-
JAVA_HOME = 'C:\\\\PROGRA~1\\\\ECLIPS~1\\\\jdk-17.0.11+9\\\\'
33-
PATH = "%JAVA_HOME%\\\\bin;C:\\\\ProgramData\\\\Boxstarter;C:\\\\Program Files\\\\IcedTeaWeb\\\\WebStart\\\\bin;C:\\\\Users\\\\jenkins_vnc\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps;${env.PATH}"
32+
JAVA_HOME = 'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-17.0.11+9'
33+
ANT_HOME = tool(type:'ant', name:'apache-ant-latest')
34+
PATH = "${JAVA_HOME}\\\\bin;${ANT_HOME}\\\\bin;${PATH}"
35+
ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}\\\\tmp -Djava.security.manager=allow"
3436
}
3537
steps {
3638
cleanWs() // workspace not cleaned by default
3739
bat \'\'\'
38-
rem May want to try and restrict path, as we do on cron jobs, so we
39-
rem have more consistent conditions.
40-
rem export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/bin
40+
@REM May want to try and restrict path, as we do on cron jobs, so we
41+
@REM have more consistent conditions.
42+
@REM export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/bin
4143
42-
rem tmp must already exist, for Java to make use of it, in subsequent steps
43-
rem no -p (or /p) needed on Windows. It creates
44+
@REM tmp must already exist, for Java to make use of it, in subsequent steps
45+
@REM no -p (or /p) needed on Windows. It creates
4446
mkdir tmp
4547
46-
rem Note: currently this file always comes from master, no matter what branch is being built/tested.
47-
wget -O getEBuilder.xml --no-verbose https://download.eclipse.org/eclipse/relengScripts/production/testScripts/hudsonBootstrap/getEBuilder.xml 2>&1
48-
set buildId
49-
wget -O buildProperties.properties https://download.eclipse.org/eclipse/downloads/drops4/%buildId%/buildproperties.properties
48+
@REM Note: currently this file always comes from master, no matter what branch is being built/tested.
49+
curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/production/testScripts/hudsonBootstrap/getEBuilder.xml
50+
curl -o buildProperties.properties https://download.eclipse.org/eclipse/downloads/drops4/%buildId%/buildproperties.properties
5051
echo off
5152
For /F "tokens=1* delims==" %%A IN (buildProperties.properties) DO (
5253
IF "%%A"=="STREAM " set STREAM=%%B
5354
IF "%%A"=="EBUILDER_HASH " set EBUILDER_HASH=%%B
5455
)
5556
echo on
56-
set STREAM
57-
set EBUILDER_HASH
57+
5858
set JAVA_HOME
59+
set ANT_HOME
60+
set PATH
61+
62+
env 1>envVars.txt 2>&1
63+
ant -diagnostics 1>antDiagnostics.txt 2>&1
64+
java -XshowSettings -version 1>javaSettings.txt 2>&1
5965
60-
ant -f getEBuilder.xml -Djava.io.tmpdir=%WORKSPACE%/tmp -DbuildId=%buildId% -DeclipseStream=%STREAM% -DEBUILDER_HASH=%EBUILDER_HASH% ^
66+
ant -f getEBuilder.xml -DbuildId=%buildId% -DeclipseStream=%STREAM% -DEBUILDER_HASH=%EBUILDER_HASH% ^
6167
-DdownloadURL="https://download.eclipse.org/eclipse/downloads/drops4/%buildId%" ^
6268
-Dargs=all -Dosgi.os=win32 -Dosgi.ws=win32 -Dosgi.arch=x86_64 ^
63-
-DtestSuite=all ^
64-
-Djvm="%JAVA_HOME%\\\\bin\\\\java.exe"
65-
69+
-DtestSuite=all
70+
@REM For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903
6671
\'\'\'
6772
archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt'
6873
junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml'

production/testScripts/configuration/sdk.tests/testScripts/runtests.bat

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ set /p launcher-jar=<launcher-jar-name.txt
6969
echo "list all environment variables in effect as tests start"
7070
set
7171

72-
rem -Dtimeout=300000 "%ANT_OPTS%"
73-
7472
IF NOT EXIST %jvm% (
7573
ECHO ERROR: jvm not defined or does not exist: %jvm%
7674
exit 1
@@ -80,11 +78,11 @@ REM -XshowSettings is supported on windows VMs but ... not every where. So where
8078
REM causes VM to not start at all. Can be handy for diagnostics. (without running ant <echoproperties/>
8179

8280
IF DEFINED extdirproperty (
83-
%jvm% %extdirproperty% -Dosgi.os=%os% -Dosgi.ws=%ws% -Dosgi.arch=%arch% -jar eclipse\plugins\%launcher-jar% -data workspace -application org.eclipse.ant.core.antRunner -file test.xml %tests% -Dws=%ws% -Dos=%os% -Darch=%arch% -D%installmode%=true %properties% -logger org.apache.tools.ant.DefaultLogger
81+
%jvm% %ANT_OPTS% %extdirproperty% -Dosgi.os=%os% -Dosgi.ws=%ws% -Dosgi.arch=%arch% -jar eclipse\plugins\%launcher-jar% -data workspace -application org.eclipse.ant.core.antRunner -file test.xml %tests% -Dws=%ws% -Dos=%os% -Darch=%arch% -D%installmode%=true %properties% -logger org.apache.tools.ant.DefaultLogger
8482
GOTO END
8583
)
8684

87-
%jvm% -Dosgi.os=%os% -Dosgi.ws=%ws% -Dosgi.arch=%arch% -jar eclipse\plugins\%launcher-jar% -data workspace -application org.eclipse.ant.core.antRunner -file test.xml %tests% -Dws=%ws% -Dos=%os% -Darch=%arch% -D%installmode%=true %properties% -logger org.apache.tools.ant.DefaultLogger
85+
%jvm% %ANT_OPTS% -Dosgi.os=%os% -Dosgi.ws=%ws% -Dosgi.arch=%arch% -jar eclipse\plugins\%launcher-jar% -data workspace -application org.eclipse.ant.core.antRunner -file test.xml %tests% -Dws=%ws% -Dos=%os% -Darch=%arch% -D%installmode%=true %properties% -logger org.apache.tools.ant.DefaultLogger
8886

8987
:END
9088

production/testScripts/configuration/sdk.tests/testScripts/runtests.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,11 @@ echo "platformParmString: ${platformParmString}"
217217
echo "platformString: ${platformString}"
218218
echo "testedPlatform: ${testedPlatform}"
219219

220-
# -Dtimeout=300000 "${ANT_OPTS}"
221220
if [[ -n "${extdirproperty}" ]]
222221
then
223222
echo "running with extdir defined"
224-
$jvm ${ANT_OPTS} "${extdirproperty}" ${platformArgString} -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml ${ANT_OPTS} ${platformParmString} -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger $tests 2>&1 | tee $consolelogs
223+
$jvm ${ANT_OPTS} "${extdirproperty}" ${platformArgString} -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml ${platformParmString} -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger $tests
225224
else
226225
echo "running without extdir defined"
227-
$jvm ${ANT_OPTS} ${platformArgString} -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml ${ANT_OPTS} ${platformParmString} -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger $tests 2>&1 | tee $consolelogs
226+
$jvm ${ANT_OPTS} ${platformArgString} -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml ${platformParmString} -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger $tests
228227
fi

production/testScripts/configuration/sdk.tests/testScripts/runtestsmac.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,11 @@ fi
131131

132132
echo "properties: $properties"
133133

134-
# -Dtimeout=300000 "${ANT_OPTS}"
135134
if [[ ! -z "${extdirproperty}" ]]
136135
then
137-
$jvm "${extdirproperty}" -Dosgi.os=$os -Dosgi.ws=$ws -Dosgi.arch=$arch -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
136+
$jvm ${ANT_OPTS} "${extdirproperty}" -Dosgi.os=$os -Dosgi.ws=$ws -Dosgi.arch=$arch -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
138137
else
139-
$jvm -Dosgi.os=$os -Dosgi.ws=$ws -Dosgi.arch=$arch -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
138+
$jvm ${ANT_OPTS} -Dosgi.os=$os -Dosgi.ws=$ws -Dosgi.arch=$arch -jar $launcher -data workspace -application org.eclipse.ant.core.antRunner -file ${PWD}/test.xml $tests -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $properties -logger org.apache.tools.ant.DefaultLogger
140139
fi
141140

142141

production/testScripts/runTests2.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,14 @@
842842
name="VMSource"
843843
value="VM used for tests, is same that invoked Ant: '${java.home}/bin/java' (that is, 'jvm' not specified by caller)." />
844844
<echo message="VMSource: ${VMSource}" />
845-
<property
846-
name="jvm"
847-
value="${java.home}/bin/java" />
845+
<condition
846+
property="jvm"
847+
value="${java.home}\bin\java.exe"
848+
else="${java.home}/bin/java">
849+
<equals
850+
arg1="${testPlatform}"
851+
arg2="windows" />
852+
</condition>
848853

849854
<echo message="full output from 'java -version' of ${jvm} is" />
850855
<exec

production/testScripts/test_runTests2.xml.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export WORKSPACE=${HOME}/tempworkarea
5151
# This variable signals parts of the script that we are testing the test scripts,
5252
# and should not actually start the tests.
5353
export TESTING_TEST_XML=true
54-
#export ANT_OPTS=-Xms1024m -Xmx1024m -Djava.io.tmpdir=${WORKSPACE}/tmp
5554
export ANT_OPTS=-Djava.io.tmpdir=${WORKSPACE}/tmp
5655
mkdir -p ${WORKSPACE}/tmp
5756
if [[ "$1" == "-c" ]]

0 commit comments

Comments
 (0)