blob: e2af86c0dbf0646da52e5e029e2990309d2716d8 [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_williamsad2097e2008-01-28 06:06:12 +0000250 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000251 value="-nosplash"/>
david_williamsad2097e2008-01-28 06:06:12 +0000252 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000253 value="-consolelog"/>
david_williamsad2097e2008-01-28 06:06:12 +0000254 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000255 value="-data"/>
david_williamsad2097e2008-01-28 06:06:12 +0000256 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000257 value="${testRoot}/overallTestWorkspace"/>
david_williamsad2097e2008-01-28 06:06:12 +0000258 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000259 value="-application"/>
david_williamsad2097e2008-01-28 06:06:12 +0000260 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000261 value="org.eclipse.ant.core.antRunner"/>
david_williamsad2097e2008-01-28 06:06:12 +0000262 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000263 value="-file"/>
david_williamsad2097e2008-01-28 06:06:12 +0000264 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000265 value="${testRoot}/test.xml"/>
david_williamsad2097e2008-01-28 06:06:12 +0000266 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000267 value="-logger"/>
david_williamsad2097e2008-01-28 06:06:12 +0000268 <arg
david_williams8e4dc9c2008-07-06 08:08:58 +0000269 value="org.apache.tools.ant.DefaultLogger"/>
david_williams403beae2007-12-09 02:10:40 +0000270 <env
271 key="DISPLAY"
david_williams8e4dc9c2008-07-06 08:08:58 +0000272 value="${env.DISPLAY}"/>
david_williams403beae2007-12-09 02:10:40 +0000273 <redirector
274 output="${testRoot}/results/fullOutput.txt"
david_williams8e4dc9c2008-07-06 08:08:58 +0000275 error="${testRoot}/results/fullErrorLog.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000276 <sysproperty
277 key="build.home"
david_williams8e4dc9c2008-07-06 08:08:58 +0000278 value="${env.BUILD_HOME}"/>
david_williams403beae2007-12-09 02:10:40 +0000279 <sysproperty
280 key="buildDirectory"
david_williams8e4dc9c2008-07-06 08:08:58 +0000281 value="${buildDirectory}"/>
david_williams403beae2007-12-09 02:10:40 +0000282 <sysproperty
283 key="buildLabel"
david_williams8e4dc9c2008-07-06 08:08:58 +0000284 value="${buildLabel}"/>
david_williams403beae2007-12-09 02:10:40 +0000285 <sysproperty
286 key="baseLocation"
david_williams8e4dc9c2008-07-06 08:08:58 +0000287 value="${baseLocation}"/>
david_williams403beae2007-12-09 02:10:40 +0000288 <sysproperty
289 key="testRoot"
david_williams8e4dc9c2008-07-06 08:08:58 +0000290 value="${testRoot}"/>
david_williams403beae2007-12-09 02:10:40 +0000291 <sysproperty
292 key="testDir"
david_williams8e4dc9c2008-07-06 08:08:58 +0000293 value="${testRoot}"/>
david_williams403beae2007-12-09 02:10:40 +0000294 <sysproperty
295 key="perf.buildId"
david_williams8e4dc9c2008-07-06 08:08:58 +0000296 value="${buildType}${date}-${time}"/>
david_williams403beae2007-12-09 02:10:40 +0000297 <sysproperty
298 key="eclipseBuilderDirectory"
david_williams8e4dc9c2008-07-06 08:08:58 +0000299 value="${pde.builder.path}"/>
david_williams403beae2007-12-09 02:10:40 +0000300 <sysproperty
301 key="buildLabel"
david_williams8e4dc9c2008-07-06 08:08:58 +0000302 value="${buildLabel}"/>
david_williams403beae2007-12-09 02:10:40 +0000303 </java>
david_williamsad2097e2008-01-28 06:06:12 +0000304 <echo
david_williams8e4dc9c2008-07-06 08:08:58 +0000305 message="wtpmasterjunitresult ${wtpmasterjunitresult}"/>
david_williams403beae2007-12-09 02:10:40 +0000306 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000307 <target
308 name="postRunTestEclipse">
david_williams403beae2007-12-09 02:10:40 +0000309 <copy
310 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testLogs"
311 overwrite="true"
312 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000313 <fileset
314 dir="${testRoot}/results">
315 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000316 name="*output.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000317 </fileset>
318 </copy>
319 <copy
320 todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testSysErrorLogs"
321 overwrite="true"
322 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000323 <fileset
324 dir="${testRoot}/results">
325 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000326 name="*error.txt"/>
david_williams403beae2007-12-09 02:10:40 +0000327 </fileset>
328 </copy>
329 <copy
330 file="${testRoot}/results/fullOutput.txt"
331 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
332 overwrite="true"
333 failonerror="false">
334 </copy>
335 <copy
336 file="${testRoot}/results/fullErrorLog.txt"
337 toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full"
338 overwrite="true"
339 failonerror="false">
340 </copy>
david_williams403beae2007-12-09 02:10:40 +0000341 <copy
342 todir="${buildDirectory}/${buildLabel}/testResults/xml"
343 overwrite="true"
344 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000345 <fileset
346 dir="${testRoot}/results/xml">
347 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000348 name="*.xml"/>
david_williams403beae2007-12-09 02:10:40 +0000349 </fileset>
350 </copy>
351 <copy
352 todir="${buildDirectory}/${buildLabel}/testResults/html"
353 overwrite="true"
354 failonerror="false">
david_williamsad2097e2008-01-28 06:06:12 +0000355 <fileset
356 dir="${testRoot}/results/html">
357 <include
david_williams8e4dc9c2008-07-06 08:08:58 +0000358 name="*.html"/>
david_williams403beae2007-12-09 02:10:40 +0000359 </fileset>
360 </copy>
361 </target>
david_williamsad2097e2008-01-28 06:06:12 +0000362</project>