-
Notifications
You must be signed in to change notification settings - Fork 66
/
ep426I_unit_win32_java11.groovy
142 lines (127 loc) · 5.48 KB
/
ep426I_unit_win32_java11.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
job('AutomatedTests/ep426I-unit-win32-java11'){
description('Run Eclipse SDK Windows Tests ')
logRotator {
numToKeep(25)
}
parameters {
stringParam('buildId', null, 'Build Id to test (such as I20120717-0800, N20120716-0800). ')
}
label('qa6xd-win11')
authenticationToken('windows2012tests')
wrappers { //adds pre/post actions
timestamps()
timeout {
absolute(901)
}
}
steps {
batchFile('''
@echo off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
echo start cleaning ...
IF NOT DEFINED WORKSPACE (
echo ERROR: WORKSPACE variable was not defined.
exit /B 1
) ELSE (
IF NOT EXIST "%WORKSPACE%" (
echo ERROR: WORKSPACE was defined, but it did not exist.
echo It was defined as %WORKSPACE%
exit /B 1
) ELSE (
echo WORSPACE defined as %WORKSPACE%
echo Will delete contents, for clean run.
rem Note that rmdir and rm do not return ERRORLEVEL.
rem Which is why we "do while" until count of files is zero.
rem (or, until max loops is reached).
set /a maxLoops=15
echo maxLoops: !maxLoops!
set /a sleepTime=60000
echo sleepTime: !sleepTime!
set /a currentLoop=0
set /a nFilesOrDirs=0
for /D %%f in ("%WORKSPACE%\\*") do set /a nFilesOrDirs+=1
for %%f in ("%WORKSPACE%\\*") do set /a nFilesOrDirs+=1
echo currentLoop: !currentLoop! nFilesOrDirs: !nFilesOrDirs!
:LOOP
IF !nFilesOrDirs! GTR 0 (
rem this first for loop is for all subdirectories of workspace
FOR /D %%p IN ("%WORKSPACE%\\*") DO (
echo removing dir: %%p
rmdir "%%p" /s /q
)
rem this for loop is for for all files remaining, directly under workspace
FOR %%p IN ("%WORKSPACE%\\*") DO (
echo deleting file: %%p
del "%%p" /q
)
set /a currentLoop+=1
IF !currentLoop! GTR !maxLoops! GOTO MAXLOOPS
set /a nFilesOrDirs=0
for /D %%f in ("%WORKSPACE%\\*") do set /a nFilesOrDirs+=1
for %%f in ("%WORKSPACE%\\*") do set /a nFilesOrDirs+=1
echo currentLoop: !currentLoop! nFilesOrDirs: !nFilesOrDirs!
if !nFilesOrDirs! GTR 0 (
rem Pause a bit before retrying, since if we could not delete, likely due to some process still running.
rem 'timeout' causes "redirection not allowed" error. See bug 482598.
rem C:\\Windows\\System32\\timeout.exe /t !sleepTime!
ping 127.0.0.1 -n1 -w !sleepTime! >NUL
GOTO LOOP
)
)
)
)
echo ... normal end of cleaning section (i.e. max loops NOT reached)
exit 0
:MAXLOOPS
echo Reached max loops waiting for files to be free to delete
rem note use of "hard exit" (no /B) as an attempt to get Hudson to fail.
exit 0
''')
batchFile('''
rem May want to try and restrict path, as we do on cron jobs, so we
rem have more consistent conditions.
rem export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/bin
rem tmp must already exist, for Java to make use of it, in subsequent steps
rem no -p (or /p) needed on Windows. It creates
mkdir tmp
rem Note: currently this file always comes from master, no matter what branch is being built/tested.
wget -O getEBuilder.xml --no-verbose https://download.eclipse.org/eclipse/relengScripts/production/testScripts/hudsonBootstrap/getEBuilder.xml 2>&1
set buildId
wget -O buildProperties.properties https://download.eclipse.org/eclipse/downloads/drops4/%buildId%/buildproperties.properties
echo off
For /F "tokens=1* delims==" %%A IN (buildProperties.properties) DO (
IF "%%A"=="STREAM " set STREAM=%%B
IF "%%A"=="EBUILDER_HASH " set EBUILDER_HASH=%%B
)
echo on
set STREAM
set EBUILDER_HASH
set JAVA_HOME=C:\\openjdk\\jdk-11\\
set JAVA_HOME
rem set Path="C:\\openjdk\\jdk-11\\bin;C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.202.08\\bin";C:\\ProgramData\\Boxstarter;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\tools\\cygwin\\bin;C:\\Program Files\\IcedTeaWeb\\WebStart\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Users\\jenkins_vnc\\AppData\\Local\\Microsoft\\WindowsApps;
ant -f getEBuilder.xml -Djava.io.tmpdir=%WORKSPACE%\\tmp -Djvm="C:\\\\openjdk\\\\jdk-11\\\\bin\\\\java.exe" -DbuildId=%buildId% -DeclipseStream=%STREAM% -DEBUILDER_HASH=%EBUILDER_HASH% -DdownloadURL="https://download.eclipse.org/eclipse/downloads/drops4/%buildId%" -Dargs=all -Dosgi.os=win32 -Dosgi.ws=win32 -Dosgi.arch=x86_64 -DtestSuite=all
''')
}
publishers {
archiveJunit('**/eclipse-testing/results/xml/*.xml') {
retainLongStdout()
healthScaleFactor((1.0).doubleValue())
}
archiveArtifacts {
pattern('**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt')
}
extendedEmail {
recipientList("sravankumarl@in.ibm.com")
}
downstreamParameterized {
trigger('Releng/ep-collectResults') {
condition('ALWAYS')
parameters {
predefinedProp('triggeringJob', '$JOB_BASE_NAME')
predefinedProp('triggeringBuildNumber', '$BUILD_NUMBER')
predefinedProp('buildId', '$buildId')
}
}
}
}
}