blob: 7fbc499dac540ca05dd5537853789c3704c7c52a [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"/>
13 <!-- required to get proper value of dropinsFolder -->
14 <property
15 name="keyCfgFile"
16 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
17 <echo
david_williamsd1184892008-07-07 02:45:47 +000018 level="debug"
david_williams8e4dc9c2008-07-06 08:08:58 +000019 message="keyCfgFile: ${keyCfgFile}"/>
20 <property
21 file="${keyCfgFile}"/>
david_williams403beae2007-12-09 02:10:40 +000022 <fail
23 message="testRoot must be set for this task"
david_williams8e4dc9c2008-07-06 08:08:58 +000024 unless="testRoot"/>
ndaib8cedc82005-09-13 18:00:32 +000025
david_williams43089362008-03-25 05:43:38 +000026 <!--
27 Steps to do after the build is done.
28 -->
david_williamsad2097e2008-01-28 06:06:12 +000029 <target
30 name="test">
david_williams403beae2007-12-09 02:10:40 +000031 <dirname
32 file="${ant.file}"
david_williams8e4dc9c2008-07-06 08:08:58 +000033 property="currentDirectory"/>
david_williams403beae2007-12-09 02:10:40 +000034 <ant
35 antfile="${ant.file}"
36 target="runTest"
david_williams8e4dc9c2008-07-06 08:08:58 +000037 dir="${currentDirectory}"/>
david_williams403beae2007-12-09 02:10:40 +000038 </target>
ndaib8cedc82005-09-13 18:00:32 +000039
david_williams43089362008-03-25 05:43:38 +000040 <!--
41 Steps to do to test the build results
42 -->
david_williamsad2097e2008-01-28 06:06:12 +000043 <target
44 name="runTest">
david_williams403beae2007-12-09 02:10:40 +000045 <dirname
46 file="${ant.file}"
david_williams8e4dc9c2008-07-06 08:08:58 +000047 property="test.component.dir"/>
david_williamsad2097e2008-01-28 06:06:12 +000048 <ant
david_williams8e4dc9c2008-07-06 08:08:58 +000049 antfile="${wtp.builder.home}/scripts/build/label.xml"/>
david_williamsad2097e2008-01-28 06:06:12 +000050 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000051 file="${buildDirectory}/label.properties"/>
david_williamsad2097e2008-01-28 06:06:12 +000052 <property
david_williams8e4dc9c2008-07-06 08:08:58 +000053 file="${wtp.builder.home}/build.properties"/>
david_williams403beae2007-12-09 02:10:40 +000054 <fail
55 message="testRoot must be set for this task"
david_williams8e4dc9c2008-07-06 08:08:58 +000056 unless="testRoot"/>
david_williamsad2097e2008-01-28 06:06:12 +000057 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000058 dir="${testRoot}"/>
david_williamsf5f131a2007-03-17 06:12:13 +000059
david_williams403beae2007-12-09 02:10:40 +000060 <!-- if results already exist, delete them -->
61 <delete
62 dir="${testRoot}/results"
david_williams8e4dc9c2008-07-06 08:08:58 +000063 failOnError="false"/>
david_williamsad2097e2008-01-28 06:06:12 +000064 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000065 dir="${testRoot}/results"/>
david_williamsad2097e2008-01-28 06:06:12 +000066 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000067 dir="${testRoot}/results/consolelogs"/>
david_williamsad2097e2008-01-28 06:06:12 +000068 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000069 dir="${testRoot}/results/consolelogs/metadata-logs"/>
david_williamsad2097e2008-01-28 06:06:12 +000070 <mkdir
david_williams8e4dc9c2008-07-06 08:08:58 +000071 dir="${testRoot}/results/consolelogs/configuration-logs"/>
david_williams403beae2007-12-09 02:10:40 +000072 <copy
73 todir="${testRoot}"
74 overwrite="true">
david_williamsad2097e2008-01-28 06:06:12 +000075 <fileset
david_williams8e4dc9c2008-07-06 08:08:58 +000076 dir="${test.component.dir}/testScripts"/>
david_williams403beae2007-12-09 02:10:40 +000077 </copy>
david_williams403beae2007-12-09 02:10:40 +000078 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +000079 message="BASEOS: ${env.BASEOS} BASEWS: ${env.BASEWS} BASEARCH: ${env.BASEARCH} "/>
david_williams403beae2007-12-09 02:10:40 +000080 <ant
81 antfile="${test.component.dir}/testdependency.xml"
82 target="get">
83 <property
84 name="dependency.properties"
david_williams8e4dc9c2008-07-06 08:08:58 +000085 value="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties"/>
david_williams403beae2007-12-09 02:10:40 +000086 <property
87 name="base.install.dir"
david_williams8e4dc9c2008-07-06 08:08:58 +000088 value="${testRoot}"/>
david_williams403beae2007-12-09 02:10:40 +000089 </ant>
david_williamsad2097e2008-01-28 06:06:12 +000090 <antcall
david_williams8e4dc9c2008-07-06 08:08:58 +000091 target="unzipTests"/>
david_williamsad2097e2008-01-28 06:06:12 +000092 <antcall
93 target="runTestEclipse">
david_williams403beae2007-12-09 02:10:40 +000094 <param
95 name="testTarget"
david_williams8e4dc9c2008-07-06 08:08:58 +000096 value="all"/>
david_williams403beae2007-12-09 02:10:40 +000097 </antcall>
david_williamsad2097e2008-01-28 06:06:12 +000098 <antcall
99 target="postRunTestEclipse">
david_williams403beae2007-12-09 02:10:40 +0000100 <param
101 name="testTarget"
david_williams8e4dc9c2008-07-06 08:08:58 +0000102 value="all"/>
david_williams403beae2007-12-09 02:10:40 +0000103 </antcall>
david_williams403beae2007-12-09 02:10:40 +0000104 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000105 <target
106 name="unzipTests">
david_williams8e4dc9c2008-07-06 08:08:58 +0000107 <!--
108 unzip the builds and junit tests we use 'unzip' here, so we
109 can continue on error, if desired. (such as if zip was not
110 created, due to other failures or options).
david_williams403beae2007-12-09 02:10:40 +0000111 -->
112 <exec
113 dir="${buildDirectory}/${buildLabel}"
114 executable="unzip"
115 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000116 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000117 line="-o -qq wtp-sdk-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000118 </exec>
david_williams403beae2007-12-09 02:10:40 +0000119 <exec
120 dir="${buildDirectory}/${buildLabel}"
121 executable="unzip"
122 failonerror="false">
123 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000124 line="-o -qq wtp-wst-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000125 </exec>
126 <exec
127 dir="${buildDirectory}/${buildLabel}"
128 executable="unzip"
129 failonerror="false">
130 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000131 line="-o -qq wtp-jst-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000132 </exec>
david_williams403beae2007-12-09 02:10:40 +0000133 <exec
134 dir="${buildDirectory}/${buildLabel}"
135 executable="unzip"
136 failonerror="false">
137 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000138 line="-o -qq wtp-jpt-sdk-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000139 </exec>
140 <exec
141 dir="${buildDirectory}/${buildLabel}"
142 executable="unzip"
143 failonerror="false">
144 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000145 line="-o -qq wtp-jpt-Automated-Tests-${buildLabel}.zip -d ${testRoot}${dropinsFolder}"/>
david_williams403beae2007-12-09 02:10:40 +0000146 </exec>
david_williams403beae2007-12-09 02:10:40 +0000147 </target>
david_williams8e4dc9c2008-07-06 08:08:58 +0000148 <!--
149 time out may need to be set/adjust for api or performance tests?
150 This testTimeLimit is the whole, overall limit on tests. There's
151 a shorter one for individual suites. some common values, of
david_williamscac5f302008-08-09 19:18:59 +0000152 milliseconds to more recognizable units:
153 14400000: 4 hours
154 7200000: 2 hours
155 3600000: 1 hour
156 1800000: 30 minutes
157 600000: 10 minutes
david_williams403beae2007-12-09 02:10:40 +0000158 -->
david_williams403beae2007-12-09 02:10:40 +0000159 <property
160 name="testTimeLimit"
david_williams8e4dc9c2008-07-06 08:08:58 +0000161 value="14400000"/>
david_williams403beae2007-12-09 02:10:40 +0000162 <property
163 name="testFailOnError"
david_williams8e4dc9c2008-07-06 08:08:58 +0000164 value="false"/>
david_williams403beae2007-12-09 02:10:40 +0000165 <target
166 name="runTestEclipse"
167 description="Run our JUnit's within an instance of antRunner">
david_williams403beae2007-12-09 02:10:40 +0000168 <property
169 name="test-vm"
david_williamsdbd9d832009-01-13 06:37:49 +0000170 value="${env.JAVA_6_HOME}/bin/java"/>
david_williams403beae2007-12-09 02:10:40 +0000171 <property
172 name="plugin-path"
david_williams8e4dc9c2008-07-06 08:08:58 +0000173 value="${testRoot}${dropinsFolder}/eclipse/plugins"/>
david_williams403beae2007-12-09 02:10:40 +0000174 <property
175 name="vmargs"
david_williams3ac3b032008-09-23 05:23:34 +0000176 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 +0000177 <!--
178 set path to eclipse folder. If local folder, use '.';
179 otherwise, use c:\path\to\eclipse or /path/to/eclipse/
180 -->
david_williams403beae2007-12-09 02:10:40 +0000181 <property
182 name="eclipse.home"
david_williams8e4dc9c2008-07-06 08:08:58 +0000183 value="${testRoot}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000184 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000185 message="Running junits"/>
186 <!--
187 If there is not exactly one launcher in the stack, we'd best
188 fail fast, since we are not expecting that, and may indicate
189 an installation that would produce unpredictable results
david_williams403beae2007-12-09 02:10:40 +0000190 -->
david_williams8e4dc9c2008-07-06 08:08:58 +0000191 <!--
192 requires ant 1.7, and at this point, we're running 1.6 from
193 eclipse ... <condition property="expectedNumberOfLaunchers">
194 <resourcecount when="equal" count="1" > <fileset
195 dir="${testRoot}/eclipse/plugins"> <include
196 name="org.eclipse.equinox.launcher_*.jar" /> </fileset>
197 </resourcecount> </condition> <fail message="Did not find
198 expected number of launcher jars. Check installation."
199 unless="expectedNumberOfLaunchers" />
200 -->
201 <!--
202 Remember: using -debug for org.eclipse.ant.core.antRunner
203 produces ant debug info to be output ... which is a TON of
204 stuff
david_williams403beae2007-12-09 02:10:40 +0000205 -->
david_williams43089362008-03-25 05:43:38 +0000206 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000207 message="eclipse.launcher: ${eclipse.launcher}"/>
david_williams403beae2007-12-09 02:10:40 +0000208 <java
209 taskname="unit-test-masterprocess"
210 fork="true"
211 resultProperty="wtpmasterjunitresult"
212 failonerror="false"
213 timeout="${testTimeLimit}"
214 dir="${testRoot}/eclipse"
david_williamsdbd9d832009-01-13 06:37:49 +0000215 jvm="${env.JAVA_6_HOME}/bin/java"
david_williams403beae2007-12-09 02:10:40 +0000216 classname="org.eclipse.equinox.launcher.Main">
217 <classpath>
david_williamsad2097e2008-01-28 06:06:12 +0000218 <fileset
219 dir="${testRoot}/eclipse/plugins">
220 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000221 name="org.eclipse.equinox.launcher_*.jar"/>
david_williams403beae2007-12-09 02:10:40 +0000222 </fileset>
223 </classpath>
david_williamsad2097e2008-01-28 06:06:12 +0000224 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000225 value="-Xverify"/>
david_williams015c81c2008-05-18 05:09:45 +0000226 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000227 value="-Dosgi.ws=${env.BASEWS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000228 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000229 value="-Dosgi.os=${env.BASEOS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000230 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000231 value="-Dosgi.arch=${env.BASEARCH}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000232 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000233 value="-Dws=${env.BASEWS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000234 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000235 value="-Dos=${env.BASEOS}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000236 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000237 value="-Darch=${env.BASEARCH}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000238 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000239 value="-Dnoclean=true"/>
david_williamsad2097e2008-01-28 06:06:12 +0000240 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000241 value="-DbuildBranch=${buildBranch}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000242 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000243 value="-DbuildType=${buildType}"/>
david_williamsad2097e2008-01-28 06:06:12 +0000244 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000245 value="-DbuildId=${buildId}"/>
david_williams26f3a5f2008-03-07 22:56:23 +0000246 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000247 value="-Dprojectname=${projectname}"/>
david_williamscf432b52008-05-13 04:58:34 +0000248 <jvmarg
david_williams8e4dc9c2008-07-06 08:08:58 +0000249 value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
david_williams15815ba2009-03-17 06:02:20 +0000250 <arg
251 value="--launcher.suppressErrors"/>
252 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000253 value="-nosplash"/>
david_williamsad2097e2008-01-28 06:06:12 +0000254 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000255 value="-consolelog"/>
david_williamsad2097e2008-01-28 06:06:12 +0000256 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000257 value="-data"/>
david_williamsad2097e2008-01-28 06:06:12 +0000258 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000259 value="${testRoot}/overallTestWorkspace"/>
david_williamsad2097e2008-01-28 06:06:12 +0000260 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000261 value="-application"/>
david_williamsad2097e2008-01-28 06:06:12 +0000262 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000263 value="org.eclipse.ant.core.antRunner"/>
david_williamsad2097e2008-01-28 06:06:12 +0000264 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000265 value="-file"/>
david_williamsad2097e2008-01-28 06:06:12 +0000266 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000267 value="${testRoot}/test.xml"/>
david_williamsad2097e2008-01-28 06:06:12 +0000268 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000269 value="-logger"/>
david_williamsad2097e2008-01-28 06:06:12 +0000270 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000271 value="org.apache.tools.ant.DefaultLogger"/>
david_williams403beae2007-12-09 02:10:40 +0000272 <env
273 key="DISPLAY"
david_williams8e4dc9c2008-07-06 08:08:58 +0000274 value="${env.DISPLAY}"/>
david_williams403beae2007-12-09 02:10:40 +0000275 <redirector
276 output="${testRoot}/results/fullOutput.txt"
david_williams8e4dc9c2008-07-06 08:08:58 +0000277 error="${testRoot}/results/fullErrorLog.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000278 <sysproperty
279 key="build.home"
david_williams8e4dc9c2008-07-06 08:08:58 +0000280 value="${env.BUILD_HOME}"/>
david_williams403beae2007-12-09 02:10:40 +0000281 <sysproperty
282 key="buildDirectory"
david_williams8e4dc9c2008-07-06 08:08:58 +0000283 value="${buildDirectory}"/>
david_williams403beae2007-12-09 02:10:40 +0000284 <sysproperty
285 key="buildLabel"
david_williams8e4dc9c2008-07-06 08:08:58 +0000286 value="${buildLabel}"/>
david_williams403beae2007-12-09 02:10:40 +0000287 <sysproperty
288 key="baseLocation"
david_williams8e4dc9c2008-07-06 08:08:58 +0000289 value="${baseLocation}"/>
david_williams403beae2007-12-09 02:10:40 +0000290 <sysproperty
291 key="testRoot"
david_williams8e4dc9c2008-07-06 08:08:58 +0000292 value="${testRoot}"/>
david_williams403beae2007-12-09 02:10:40 +0000293 <sysproperty
294 key="testDir"
david_williams8e4dc9c2008-07-06 08:08:58 +0000295 value="${testRoot}"/>
david_williams403beae2007-12-09 02:10:40 +0000296 <sysproperty
297 key="perf.buildId"
david_williams8e4dc9c2008-07-06 08:08:58 +0000298 value="${buildType}${date}-${time}"/>
david_williams403beae2007-12-09 02:10:40 +0000299 <sysproperty
300 key="eclipseBuilderDirectory"
david_williams8e4dc9c2008-07-06 08:08:58 +0000301 value="${pde.builder.path}"/>
david_williams403beae2007-12-09 02:10:40 +0000302 <sysproperty
303 key="buildLabel"
david_williams8e4dc9c2008-07-06 08:08:58 +0000304 value="${buildLabel}"/>
david_williams403beae2007-12-09 02:10:40 +0000305 </java>
david_williamsad2097e2008-01-28 06:06:12 +0000306 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000307 message="wtpmasterjunitresult ${wtpmasterjunitresult}"/>
david_williams403beae2007-12-09 02:10:40 +0000308 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000309 <target
310 name="postRunTestEclipse">
david_williams403beae2007-12-09 02:10:40 +0000311 <copy
312 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testLogs"
313 overwrite="true"
314 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000315 <fileset
316 dir="${testRoot}/results">
317 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000318 name="*output.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000319 </fileset>
320 </copy>
321 <copy
322 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testSysErrorLogs"
323 overwrite="true"
324 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000325 <fileset
326 dir="${testRoot}/results">
327 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000328 name="*error.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000329 </fileset>
330 </copy>
331 <copy
332 file="${testRoot}/results/fullOutput.txt"
333 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
334 overwrite="true"
335 failonerror="false">
336 </copy>
337 <copy
338 file="${testRoot}/results/fullErrorLog.txt"
339 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
340 overwrite="true"
341 failonerror="false">
342 </copy>
david_williams403beae2007-12-09 02:10:40 +0000343 <copy
344 todir="${buildDirectory}/${buildLabel}/testResults/xml"
345 overwrite="true"
346 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000347 <fileset
348 dir="${testRoot}/results/xml">
349 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000350 name="*.xml"/>
david_williams403beae2007-12-09 02:10:40 +0000351 </fileset>
352 </copy>
353 <copy
354 todir="${buildDirectory}/${buildLabel}/testResults/html"
355 overwrite="true"
356 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000357 <fileset
358 dir="${testRoot}/results/html">
359 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000360 name="*.html"/>
david_williams403beae2007-12-09 02:10:40 +0000361 </fileset>
362 </copy>
363 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000364</project>