| <project name="Build specific targets and properties" default="test"> |
| |
| <!-- Note to be cross-platform, "environment variables" are only appropriate for |
| some variables, e.g. ones we set, since properties are case sensitive, even if |
| the environment variables on your operating system are not, e.g. it will |
| be ${env.Path} not ${env.PATH} on Windows --> |
| <property environment="env" /> |
| |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do after the build is done. --> |
| <!-- ===================================================================== --> |
| <target name="test"> |
| <antcall target="runTest" /> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do to test the build results --> |
| <!-- ===================================================================== --> |
| <target name="runTest"> |
| |
| <dirname file="${ant.file}" property="test.component.dir" /> |
| <ant antfile="${wtp.builder.home}/scripts/build/label.xml" /> |
| <property file="${buildDirectory}/label.properties" /> |
| <property file="${wtp.builder.home}/build.properties" /> |
| |
| |
| <mkdir dir="${testRoot}" /> |
| |
| <!-- if results already exist, delete them --> |
| <delete dir="${testRoot}/results" failOnError="false"/> |
| <mkdir dir="${testRoot}/results" /> |
| <mkdir dir="${testRoot}/results/consolelogs" /> |
| <mkdir dir="${testRoot}/results/consolelogs/metadata-logs" /> |
| <mkdir dir="${testRoot}/results/consolelogs/configuration-logs" /> |
| |
| <copy todir="${testRoot}" overwrite="true"> |
| <fileset dir="${test.component.dir}/testScripts"></fileset> |
| </copy> |
| |
| <echo |
| message="BASEOS: ${env.BASEOS} BASEWS: ${env.BASEWS} BASEARCH: ${env.BASEARCH} " /> |
| |
| <ant antfile="${test.component.dir}/testdependency.xml" |
| target="get"> |
| <property name="dependency.properties" |
| value="${buildDirectory}/maps/releng/maps/dependencies.properties" /> |
| <property name="base.install.dir" value="${testRoot}" /> |
| </ant> |
| |
| <antcall target="unzipTests" /> |
| |
| <antcall target="runTestEclipse"> |
| <param name="testTarget" value="all" /> |
| </antcall> |
| <antcall target="postRunTestEclipse"> |
| <param name="testTarget" value="all" /> |
| </antcall> |
| |
| </target> |
| |
| <target name="unzipTests"> |
| |
| <!--unzip the builds and junit tests |
| we use 'unzip' here, so we can continue on error |
| (such as if zip was not created, due to other failures or options). |
| --> |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip" |
| failonerror="false"> |
| <arg line="-o -qq wtp-sdk-${buildLabel}.zip -d ${testRoot}" /> |
| </exec> |
| |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip" |
| failonerror="false"> |
| <arg |
| line="-o -qq wtp-wst-Automated-Tests-${buildLabel}.zip -d ${testRoot}" /> |
| </exec> |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip" |
| failonerror="false"> |
| <arg |
| line="-o -qq wtp-jst-Automated-Tests-${buildLabel}.zip -d ${testRoot}" /> |
| </exec> |
| |
| |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip" |
| failonerror="false"> |
| <arg |
| line="-o -qq wtp-jsf-sdk-${buildLabel}.zip -d ${testRoot}" /> |
| </exec> |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip" |
| failonerror="false"> |
| <arg |
| line="-o -qq wtp-jsf-Automated-Tests-${buildLabel}.zip -d ${testRoot}" /> |
| </exec> |
| |
| |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip" |
| failonerror="false"> |
| <arg line="-o -qq wtp-jpa-${buildLabel}.zip -d ${testRoot}" /> |
| </exec> |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip" |
| failonerror="false"> |
| <arg |
| line="-o -qq wtp-jpa-Automated-Tests-${buildLabel}.zip -d ${testRoot}" /> |
| </exec> |
| |
| </target> |
| |
| <!-- time out may need to be set/adjust for api or performance tests? |
| This testTimeLimit is the whole, overall limit on tests. There's a shorter |
| one for individual suites. |
| |
| some common values, of milliseconds to more recognizable units: |
| 7200000: 2 hours |
| 3600000: 1 hour |
| 1800000: 30 minutes |
| 600000: 10 minutes |
| --> |
| |
| <property name="testTimeLimit" value="7200000" /> |
| <property name="testFailOnError" value="false" /> |
| |
| <target name="runTestEclipse" |
| description="Run our JUnit's within an instance of antRunner"> |
| |
| |
| |
| <property name="vmargs" |
| value="-Xms256m -Xmx512m -Dosgi.ws=${env.BASEWS} -Dosgi.os=${env.BASEOS} -Dosgi.arch=${env.BASEARCH} -Dws=${env.BASEWS} -Dos=${env.BASEOS} -Darch=${env.BASEARCH} -Dosgi.clean=true -Dnoclean=true -DbuildBranch=${buildBranch} -DbuildType=${buildType} -DbuildId=${buildId}" /> |
| |
| <property name="test-vm" value="${env.JAVA_5_HOME}/bin/java" /> |
| |
| <!--ensure executable has execute permission--> |
| <chmod file="${testRoot}/eclipse/eclipse" perm="ugo+rx" /> |
| |
| |
| <echo message="Running junits" /> |
| |
| <exec executable="${testRoot}/eclipse/eclipse" |
| dir="${testRoot}/eclipse" timeout="${testTimeLimit}"> |
| <arg line="-nosplash" /> |
| <arg line="-suppressErrors" /> |
| <arg line="-debug" /> |
| <arg line="-consoleLog" /> |
| <arg line="-data ./antRunnerWorkspace" /> |
| <arg line="-vm ${test-vm}" /> |
| <arg line="-application org.eclipse.ant.core.antRunner" /> |
| <arg |
| line="-propertyfile ${test.component.dir}/testScripts/test.properties" /> |
| <arg line="-logger org.apache.tools.ant.DefaultLogger" /> |
| <arg |
| line="-file ${test.component.dir}/testScripts/test.xml all" /> |
| <arg line="-DtestRoot=${testRoot}" /> |
| <arg line="-DtestDir=${testRoot}" /> |
| <arg line="-DbuildDirectory=${buildDirectory}" /> |
| <arg line="-Dbuild.home=${env.BUILD_HOME}" /> |
| <arg line="-Dperf.buildId=${buildType}${date}-${time}" /> |
| <arg line="-DeclipseBuilderDirectory=${pde.builder.path}" /> |
| <arg line="-DbuildLabel=${buildLabel}" /> |
| <arg line="-vmargs ${vmargs}" /> |
| <env key="DISPLAY" value="${env.DISPLAY}" /> |
| <redirector output="${testRoot}/results/fullOutput.txt" |
| error="${testRoot}/results/fullErrorLog.txt" /> |
| |
| </exec> |
| |
| </target> |
| |
| <target name="postRunTestEclipse"> |
| <copy |
| todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testLogs" |
| overwrite="true"> |
| <fileset dir="${testRoot}/results"> |
| <include name="**/*output.txt" /> |
| </fileset> |
| </copy> |
| <copy |
| todir="${buildDirectory}/${buildLabel}/testResults/consolelogs/testSysErrorLogs" |
| overwrite="true"> |
| <fileset dir="${testRoot}/results"> |
| <include name="**/*error.txt" /> |
| </fileset> |
| </copy> |
| <copy file="${testRoot}/results/fullOutput.txt" |
| toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full" |
| overwrite="true"> |
| </copy> |
| <copy file="${testRoot}/results/fullErrorLog.txt" |
| toDir="${buildDirectory}/${buildLabel}/testResults/consolelogs/full" |
| overwrite="true"> |
| </copy> |
| |
| <copy todir="${buildDirectory}/${buildLabel}/testResults/xml" |
| overwrite="true"> |
| <fileset dir="${testRoot}/results/xml"> |
| <include name="*.xml" /> |
| </fileset> |
| </copy> |
| <copy todir="${buildDirectory}/${buildLabel}/testResults/html" |
| overwrite="true"> |
| <fileset dir="${testRoot}/results/html"> |
| <include name="*.html" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| |
| </project> |