blob: 5d1b27d214e37e4bdada1b98d3e015ced9696202 [file] [log] [blame]
<project
name="SimRel Tests"
basedir="."
default="runReports">
<!-- define 'env' globally -->
<property environment="env" />
<!-- The 'aggrPropertyFile' property file name is itself a property, so it can be overridden
on one machine versus another. We do it this way, instead of just specifying
-propertyFile on command line, so that the property values can be "nested"
in other property values and evaluated lazily. -->
<property
name="aggrPropertyFile"
value="aggr.properties" />
<echo message="aggrPropertyFile: ${aggrPropertyFile}" />
<property file="${aggrPropertyFile}" />
<!-- We'll put test output files right in "the p2 repository". Though, later
we will want to "save old reports", without saving the entire repository.
.../reporeports/reports contains the actual reports.
.../reporeports contains the index.html file.
-->
<property
name="testRepoDirectory"
value="${BUILD_HOME}/aggregation/final" />
<property
name="reportOutputDir"
value="${testRepoDirectory}/buildInfo" />
<!-- buildInfo should already exist, and contain "properties" of build -->
<mkdir dir="${reportOutputDir}" />
<!-- We should be passed (or, inherit) the release value from where
this script it called in build.xml.
TODO: would be best to control this value from Hudson property,
so that changes in future do not require changes in code.
NOTE: another example of where "update" and "mainline" would
be useful variables to have?
-->
<!-- reference repository for update releases is alwasy the previous release.
reference repository for mainline release should be the latest "update staging" repostory,
once it exists and is accurate.
-->
<condition
property="referenceRepoDir"
value="/home/data/httpd/download.eclipse.org/releases/photon/201806271001">
<equals
arg1="${release}"
arg2="photon" />
</condition>
<condition
property="referenceRepoDir"
value="/home/data/httpd/download.eclipse.org/releases/oxygen/201712201001">
<equals
arg1="${release}"
arg2="oxygen" />
</condition>
<condition
property="referenceRepoDir"
value="/home/data/httpd/download.eclipse.org/releases/neon/201610111000">
<equals
arg1="${release}"
arg2="neon" />
</condition>
<echo message="[DEBUG] Computing referenceRepoDir. release: ${release}" />
<echo message="[DEBUG] Computed referenceRepoDir: ${referenceRepoDir}" />
<property
name="eclipseTestExecutable"
value="${ECLIPSE_EXE}" />
<!--
Each "type" of build, ends by calling one of these targets.
So far, only the "clean build" has any real tests, be eventually others
could have some checks/tests.
-->
<target
name="validateOnlyTests"
description="Tests appropriate when only metadata available">
<echo message="No validation-only tests, yet (other then the aggregation validation itself)." />
</target>
<target
name="cachedBuildTests"
description="Tests appropriate when metadata and artifacts available (though, for cached build, may be 'extra' artifacts not cleaned up yet">
<echo message="No cached build tests, yet (other then the cached aggregation build itself)." />
</target>
<target
name="cleanBuildTests"
description="The primary and final time to test metadata and artifacts."
depends="runReports">
<echo>
Ran standard clean build reports and tests.
See report in ${reportOutputDir}.
</echo>
</target>
<target name="runReports">
<echo message="Creating Reports" />
<property
name="REPORT_APP_NAME"
value="org.eclipse.cbi.p2repo.analyzers.repoReport" />
<property
name="VM_TEST_ARGS"
value="-Djava.io.tmpdir=${BUILD_HOME}/tmp -DreportOutputDir=${reportOutputDir} -DreportRepoDir=${testRepoDirectory} -DreferenceRepo=${referenceRepoDir}" />
<echo message="in runReports: eclipseTestExecutable: ${eclipseTestExecutable}" />
<echo message="in runReports: REPORT_APP_NAME: ${REPORT_APP_NAME}" />
<echo message="in runReports: JAVA_HOME: ${JAVA_HOME}" />
<echo message="in runReports: VM_TEST_ARGS: ${VM_TEST_ARGS}" />
<echo message="in runReports: reportOutputDir: ${reportOutputDir}" />
<echo message="in runReports: testRepoDirectory: ${testRepoDirectory}" />
<echo message="in runReports: referenceRepoDir: ${referenceRepoDir}" />
<echo message="in runReports: basedir: ${basedir}" />
<exec
executable="${eclipseTestExecutable}"
dir="${basedir}"
failonerror="false"
failifexecutionfails="true"
resultproperty="applicationResult">
<arg value="-nosplash" />
<arg value="-debug" />
<arg value="--launcher.suppressErrors" />
<arg value="-application" />
<arg value="${REPORT_APP_NAME}" />
<arg value="-vmargs" />
<arg line="${VM_TEST_ARGS}" />
</exec>
<echo message="DEBUG: applicationResult: ${applicationResult}" />
<condition property="failuresoccurred">
<and>
<isset property="applicationResult" />
<not>
<equals
arg1="${applicationResult}"
arg2="0" />
</not>
</and>
</condition>
<!-- currently, we (should) never "fail" ... but, will in future -->
<!-- need to learn how to signal "unstable" to Hudson, as opposed to outright failure. -->
<fail if="failuresoccurred" />
</target>
</project>