blob: 84a77e5f7bf0aa63677abb7215dee52a3e529088 [file] [log] [blame]
david_williams403beae2007-12-09 02:10:40 +00001<project
2 name="Build specific targets and properties"
3 default="runTest">
david_williams8e4dc9c2008-07-06 08:08:58 +00004 <!--
5 Note to be cross-platform, "environment variables" are only
6 appropriate for some variables, e.g. ones we set, since
7 properties are case sensitive, even if the environment variables
8 on your operating system are not, e.g. it will be ${env.Path}
9 not ${env.PATH} on Windows
10 -->
david_williamsad2097e2008-01-28 06:06:12 +000011 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000012 environment="env"/>
david_williams2f43da22009-07-22 04:25:24 +000013 <fail
14 message="testRoot must be set for this task"
15 unless="testRoot"/>
16 <!-- required to get proper value of dropinsFolder -->
david_williams8e4dc9c2008-07-06 08:08:58 +000017 <property
18 name="keyCfgFile"
19 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
20 <echo
david_williamsd1184892008-07-07 02:45:47 +000021 level="debug"
david_williams8e4dc9c2008-07-06 08:08:58 +000022 message="keyCfgFile: ${keyCfgFile}"/>
23 <property
24 file="${keyCfgFile}"/>
david_williams2f43da22009-07-22 04:25:24 +000025
26 <!-- if not otherwise set, assume 'all' tests -->
27 <property
28 name="testTarget"
29 value="all"/>
30 <!--
31 typcially already set, but in case of standalone tests, may not
32 be
33 -->
34 <property
35 name="buildLabel"
36 value="${buildType}-${buildId}-${timestamp}"/>
37
ndaib8cedc82005-09-13 18:00:32 +000038
david_williams43089362008-03-25 05:43:38 +000039 <!--
40 Steps to do after the build is done.
41 -->
david_williamsad2097e2008-01-28 06:06:12 +000042 <target
43 name="test">
david_williams403beae2007-12-09 02:10:40 +000044 <dirname
45 file="${ant.file}"
david_williams8e4dc9c2008-07-06 08:08:58 +000046 property="currentDirectory"/>
david_williams403beae2007-12-09 02:10:40 +000047 <ant
48 antfile="${ant.file}"
49 target="runTest"
david_williams8e4dc9c2008-07-06 08:08:58 +000050 dir="${currentDirectory}"/>
david_williams403beae2007-12-09 02:10:40 +000051 </target>
ndaib8cedc82005-09-13 18:00:32 +000052
david_williams43089362008-03-25 05:43:38 +000053 <!--
54 Steps to do to test the build results
55 -->
david_williamsad2097e2008-01-28 06:06:12 +000056 <target
57 name="runTest">
david_williams403beae2007-12-09 02:10:40 +000058 <dirname
59 file="${ant.file}"
david_williams8e4dc9c2008-07-06 08:08:58 +000060 property="test.component.dir"/>
david_williamsad2097e2008-01-28 06:06:12 +000061 <ant
david_williams8e4dc9c2008-07-06 08:08:58 +000062 antfile="${wtp.builder.home}/scripts/build/label.xml"/>
david_williamsad2097e2008-01-28 06:06:12 +000063 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000064 file="${buildDirectory}/label.properties"/>
david_williamsad2097e2008-01-28 06:06:12 +000065 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000066 file="${wtp.builder.home}/build.properties"/>
david_williams403beae2007-12-09 02:10:40 +000067 <fail
68 message="testRoot must be set for this task"
david_williams8e4dc9c2008-07-06 08:08:58 +000069 unless="testRoot"/>
david_williamsad2097e2008-01-28 06:06:12 +000070 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000071 dir="${testRoot}"/>
david_williamsf5f131a2007-03-17 06:12:13 +000072
david_williams403beae2007-12-09 02:10:40 +000073 <!-- if results already exist, delete them -->
74 <delete
75 dir="${testRoot}/results"
david_williams8e4dc9c2008-07-06 08:08:58 +000076 failOnError="false"/>
david_williamsad2097e2008-01-28 06:06:12 +000077 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000078 dir="${testRoot}/results"/>
david_williamsad2097e2008-01-28 06:06:12 +000079 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000080 dir="${testRoot}/results/consolelogs"/>
david_williamsad2097e2008-01-28 06:06:12 +000081 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000082 dir="${testRoot}/results/consolelogs/metadata-logs"/>
david_williamsad2097e2008-01-28 06:06:12 +000083 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000084 dir="${testRoot}/results/consolelogs/configuration-logs"/>
david_williams403beae2007-12-09 02:10:40 +000085 <copy
86 todir="${testRoot}"
87 overwrite="true">
david_williamsad2097e2008-01-28 06:06:12 +000088 <fileset
david_williams8e4dc9c2008-07-06 08:08:58 +000089 dir="${test.component.dir}/testScripts"/>
david_williams403beae2007-12-09 02:10:40 +000090 </copy>
david_williams403beae2007-12-09 02:10:40 +000091 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +000092 message="BASEOS: ${env.BASEOS} BASEWS: ${env.BASEWS} BASEARCH: ${env.BASEARCH} "/>
david_williams403beae2007-12-09 02:10:40 +000093 <ant
94 antfile="${test.component.dir}/testdependency.xml"
95 target="get">
david_williams2f53d7b2009-08-03 05:48:34 +000096 <!-- for this distribution, dependencies come from releng.
97 assume no subdirectory, if not otherwise set (bug 285383).
98 -->
99 <property name="env.DEP_DIR" value="" />
100
101 <property
102 name="dependency.properties"
david_williams400ac772009-08-03 16:52:32 +0000103 value="${buildDirectory}/maps/${env.RELENG}${env.DEP_DIR}/maps/dependencies.properties"/>
david_williams95ee27c2009-08-03 13:16:48 +0000104 <property
david_williams403beae2007-12-09 02:10:40 +0000105 name="base.install.dir"
david_williams8e4dc9c2008-07-06 08:08:58 +0000106 value="${testRoot}"/>
david_williams403beae2007-12-09 02:10:40 +0000107 </ant>
david_williamsad2097e2008-01-28 06:06:12 +0000108 <antcall
david_williams8e4dc9c2008-07-06 08:08:58 +0000109 target="unzipTests"/>
david_williamsad2097e2008-01-28 06:06:12 +0000110 <antcall
111 target="runTestEclipse">
david_williams403beae2007-12-09 02:10:40 +0000112 </antcall>
david_williamsad2097e2008-01-28 06:06:12 +0000113 <antcall
114 target="postRunTestEclipse">
david_williams403beae2007-12-09 02:10:40 +0000115 </antcall>
david_williams403beae2007-12-09 02:10:40 +0000116 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000117 <target
118 name="unzipTests">
david_williams8e4dc9c2008-07-06 08:08:58 +0000119 <!--
120 unzip the builds and junit tests we use 'unzip' here, so we
121 can continue on error, if desired. (such as if zip was not
122 created, due to other failures or options).
david_williams403beae2007-12-09 02:10:40 +0000123 -->
124 <exec
125 dir="${buildDirectory}/${buildLabel}"
126 executable="unzip"
127 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000128 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000129 line="-o -qq wtp-sdk-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000130 </exec>
david_williams403beae2007-12-09 02:10:40 +0000131 <exec
132 dir="${buildDirectory}/${buildLabel}"
133 executable="unzip"
134 failonerror="false">
135 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000136 line="-o -qq wtp-wst-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000137 </exec>
138 <exec
139 dir="${buildDirectory}/${buildLabel}"
140 executable="unzip"
141 failonerror="false">
142 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000143 line="-o -qq wtp-jst-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000144 </exec>
david_williams403beae2007-12-09 02:10:40 +0000145 <exec
146 dir="${buildDirectory}/${buildLabel}"
147 executable="unzip"
148 failonerror="false">
149 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000150 line="-o -qq wtp-jpt-sdk-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000151 </exec>
152 <exec
153 dir="${buildDirectory}/${buildLabel}"
154 executable="unzip"
155 failonerror="false">
156 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000157 line="-o -qq wtp-jpt-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000158 </exec>
david_williams403beae2007-12-09 02:10:40 +0000159 </target>
david_williams8e4dc9c2008-07-06 08:08:58 +0000160 <!--
161 time out may need to be set/adjust for api or performance tests?
162 This testTimeLimit is the whole, overall limit on tests. There's
163 a shorter one for individual suites. some common values, of
david_williams0f242892009-07-23 00:24:10 +0000164 milliseconds to more recognizable units:
165 14400000: 4 hours
166 7200000: 2 hours
167 3600000: 1 hour
168 1800000: 30 minutes
169 600000: 10 minutes
david_williams403beae2007-12-09 02:10:40 +0000170 -->
david_williams403beae2007-12-09 02:10:40 +0000171 <property
172 name="testTimeLimit"
david_williams8e4dc9c2008-07-06 08:08:58 +0000173 value="14400000"/>
david_williams403beae2007-12-09 02:10:40 +0000174 <property
175 name="testFailOnError"
david_williams8e4dc9c2008-07-06 08:08:58 +0000176 value="false"/>
david_williams403beae2007-12-09 02:10:40 +0000177 <target
178 name="runTestEclipse"
179 description="Run our JUnit's within an instance of antRunner">
david_williams403beae2007-12-09 02:10:40 +0000180 <property
181 name="test-vm"
david_williamsdbd9d832009-01-13 06:37:49 +0000182 value="${env.JAVA_6_HOME}/bin/java"/>
david_williams403beae2007-12-09 02:10:40 +0000183 <property
184 name="plugin-path"
david_williams8e4dc9c2008-07-06 08:08:58 +0000185 value="${testRoot}${dropinsFolder}/eclipse/plugins"/>
david_williams403beae2007-12-09 02:10:40 +0000186 <property
187 name="vmargs"
david_williams3ac3b032008-09-23 05:23:34 +0000188 value="-Dosgi.ws=${env.BASEWS} -Dosgi.os=${env.BASEOS} -Dosgi.arch=${env.BASEARCH} -Dws=${env.BASEWS} -Dos=${env.BASEOS} -Darch=${env.BASEARCH} -Dnoclean=true -DbuildBranch=${buildBranch} -DbuildType=${buildType} -DbuildId=${buildId} -DtestRoot=${testRoot} -DtestDir=${testRoot} -DbuildDirectory=${buildDirectory} -Dbuild.home=${env.BUILD_HOME} -DeclipseBuilderDirectory=${pde.builder.path} -DbuildLabel=${buildLabel} -Dtest-vm=${test-vm} -Dperf.buildId=${buildType}${date}-${time}"/>
david_williams8e4dc9c2008-07-06 08:08:58 +0000189 <!--
190 set path to eclipse folder. If local folder, use '.';
191 otherwise, use c:\path\to\eclipse or /path/to/eclipse/
192 -->
david_williams403beae2007-12-09 02:10:40 +0000193 <property
194 name="eclipse.home"
david_williams8e4dc9c2008-07-06 08:08:58 +0000195 value="${testRoot}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000196 <echo
david_williams2f43da22009-07-22 04:25:24 +0000197 message="testTarget: ${testTarget}"/>
198 <echo
199 message="plugin-path: ${plugin-path}"/>
200 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000201 message="Running junits"/>
202 <!--
203 If there is not exactly one launcher in the stack, we'd best
204 fail fast, since we are not expecting that, and may indicate
205 an installation that would produce unpredictable results
david_williams403beae2007-12-09 02:10:40 +0000206 -->
david_williams8e4dc9c2008-07-06 08:08:58 +0000207 <!--
208 requires ant 1.7, and at this point, we're running 1.6 from
209 eclipse ... <condition property="expectedNumberOfLaunchers">
210 <resourcecount when="equal" count="1" > <fileset
211 dir="${testRoot}/eclipse/plugins"> <include
212 name="org.eclipse.equinox.launcher_*.jar" /> </fileset>
213 </resourcecount> </condition> <fail message="Did not find
214 expected number of launcher jars. Check installation."
215 unless="expectedNumberOfLaunchers" />
216 -->
217 <!--
218 Remember: using -debug for org.eclipse.ant.core.antRunner
219 produces ant debug info to be output ... which is a TON of
220 stuff
david_williams403beae2007-12-09 02:10:40 +0000221 -->
222 <java
223 taskname="unit-test-masterprocess"
224 fork="true"
225 resultProperty="wtpmasterjunitresult"
226 failonerror="false"
227 timeout="${testTimeLimit}"
228 dir="${testRoot}/eclipse"
david_williamsdbd9d832009-01-13 06:37:49 +0000229 jvm="${env.JAVA_6_HOME}/bin/java"
david_williams403beae2007-12-09 02:10:40 +0000230 classname="org.eclipse.equinox.launcher.Main">
231 <classpath>
david_williamsad2097e2008-01-28 06:06:12 +0000232 <fileset
233 dir="${testRoot}/eclipse/plugins">
234 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000235 name="org.eclipse.equinox.launcher_*.jar"/>
david_williams403beae2007-12-09 02:10:40 +0000236 </fileset>
237 </classpath>
david_williamsad2097e2008-01-28 06:06:12 +0000238 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000239 value="-Xverify"/>
david_williams015c81c2008-05-18 05:09:45 +0000240 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000241 value="-Dosgi.ws=${env.BASEWS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000242 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000243 value="-Dosgi.os=${env.BASEOS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000244 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000245 value="-Dosgi.arch=${env.BASEARCH}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000246 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000247 value="-Dws=${env.BASEWS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000248 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000249 value="-Dos=${env.BASEOS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000250 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000251 value="-Darch=${env.BASEARCH}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000252 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000253 value="-Dnoclean=true"/>
david_williamsad2097e2008-01-28 06:06:12 +0000254 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000255 value="-DbuildBranch=${buildBranch}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000256 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000257 value="-DbuildType=${buildType}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000258 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000259 value="-DbuildId=${buildId}"/>
david_williams26f3a5f2008-03-07 22:56:23 +0000260 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000261 value="-Dprojectname=${projectname}"/>
david_williamscf432b52008-05-13 04:58:34 +0000262 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000263 value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
david_williams2f43da22009-07-22 04:25:24 +0000264 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000265 value="-nosplash"/>
david_williamsad2097e2008-01-28 06:06:12 +0000266 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000267 value="-consolelog"/>
david_williamsad2097e2008-01-28 06:06:12 +0000268 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000269 value="-data"/>
david_williamsad2097e2008-01-28 06:06:12 +0000270 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000271 value="${testRoot}/overallTestWorkspace"/>
david_williamsad2097e2008-01-28 06:06:12 +0000272 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000273 value="-application"/>
david_williamsad2097e2008-01-28 06:06:12 +0000274 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000275 value="org.eclipse.ant.core.antRunner"/>
david_williamsad2097e2008-01-28 06:06:12 +0000276 <arg
david_williams2f43da22009-07-22 04:25:24 +0000277 value="-verbose"/>
david_williamsad2097e2008-01-28 06:06:12 +0000278 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000279 value="-logger"/>
david_williamsad2097e2008-01-28 06:06:12 +0000280 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000281 value="org.apache.tools.ant.DefaultLogger"/>
david_williams2f43da22009-07-22 04:25:24 +0000282 <arg
283 value="-file"/>
284 <arg
285 value="${testRoot}/test.xml"/>
286 <arg
287 value="${testTarget}"/>
288
289 <!-- make sure our forked env has a DISPLAY -->
david_williams403beae2007-12-09 02:10:40 +0000290 <env
291 key="DISPLAY"
david_williams8e4dc9c2008-07-06 08:08:58 +0000292 value="${env.DISPLAY}"/>
david_williams403beae2007-12-09 02:10:40 +0000293 <redirector
294 output="${testRoot}/results/fullOutput.txt"
david_williams8e4dc9c2008-07-06 08:08:58 +0000295 error="${testRoot}/results/fullErrorLog.txt"/>
david_williams2f43da22009-07-22 04:25:24 +0000296 <jvmarg
297 value="-Dbuild.home=${env.BUILD_HOME}"/>
298 <jvmarg
299 value="-DbuildDirectory=${buildDirectory}"/>
300 <jvmarg
301 value="-DbuildLabel=${buildLabel}"/>
302 <jvmarg
303 value="-DbaseLocation=${baseLocation}"/>
304 <jvmarg
305 value="-DtestRoot=${testRoot}"/>
306 <jvmarg
307 value="-DtestDir=${testRoot}"/>
308 <jvmarg
309 value="-Dperf.buildId=${buildType}${date}-${time}"/>
310 <jvmarg
311 value="-DeclipseBuilderDirectory=${pde.builder.path}"/>
312 <jvmarg
313 value="-DbuildLabel=${buildLabel}"/>
314 <jvmarg
315 value="-Dplugin-path=${plugin-path}"/>
david_williamsace71222009-07-27 08:45:28 +0000316 <!-- IBM_JAVA_OPTIONS contains JIT work arounds for bug 284441 -->
david_williams7834cd92009-07-27 08:31:46 +0000317 <env
david_williamsace71222009-07-27 08:45:28 +0000318 key="IBM_JAVA_OPTIONS"
david_williams7834cd92009-07-27 08:31:46 +0000319 value="-Xjit:exclude={org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.primGetNextToken()Ljava/lang/String;},exclude={org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.%lt;init%gt;(Ljava/io/Reader;)V},exclude={org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.primGetNextToken()Ljava/lang/String;}" />
david_williams403beae2007-12-09 02:10:40 +0000320 </java>
david_williamsad2097e2008-01-28 06:06:12 +0000321 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000322 message="wtpmasterjunitresult ${wtpmasterjunitresult}"/>
david_williams403beae2007-12-09 02:10:40 +0000323 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000324 <target
325 name="postRunTestEclipse">
david_williams403beae2007-12-09 02:10:40 +0000326 <copy
327 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testLogs"
328 overwrite="true"
329 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000330 <fileset
331 dir="${testRoot}/results">
332 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000333 name="*output.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000334 </fileset>
335 </copy>
336 <copy
337 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testSysErrorLogs"
338 overwrite="true"
339 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000340 <fileset
341 dir="${testRoot}/results">
342 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000343 name="*error.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000344 </fileset>
345 </copy>
346 <copy
347 file="${testRoot}/results/fullOutput.txt"
348 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
349 overwrite="true"
350 failonerror="false">
351 </copy>
352 <copy
353 file="${testRoot}/results/fullErrorLog.txt"
354 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
355 overwrite="true"
356 failonerror="false">
357 </copy>
david_williams403beae2007-12-09 02:10:40 +0000358 <copy
359 todir="${buildDirectory}/${buildLabel}/testResults/xml"
360 overwrite="true"
361 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000362 <fileset
363 dir="${testRoot}/results/xml">
364 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000365 name="*.xml"/>
david_williams403beae2007-12-09 02:10:40 +0000366 </fileset>
367 </copy>
368 <copy
369 todir="${buildDirectory}/${buildLabel}/testResults/html"
370 overwrite="true"
371 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000372 <fileset
373 dir="${testRoot}/results/html">
374 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000375 name="*.html"/>
david_williams403beae2007-12-09 02:10:40 +0000376 </fileset>
377 </copy>
378 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000379</project>