Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'production/testScripts/runTests2.xml')
-rw-r--r--production/testScripts/runTests2.xml1061
1 files changed, 770 insertions, 291 deletions
diff --git a/production/testScripts/runTests2.xml b/production/testScripts/runTests2.xml
index b502f93ec..5cdb42523 100644
--- a/production/testScripts/runTests2.xml
+++ b/production/testScripts/runTests2.xml
@@ -3,108 +3,21 @@
default="runTests2"
basedir=".">
- <!-- hurestic to check if we are running on hudson variable, if so -->
- <target name="checkHudson">
- <!-- HUDSON_USER should just be "anonyous" for most of our cases (currently)
- but seems a safe variable to check ... if set, assume we are on hudson,
- if not set, assume we are not and leave "hudson" unset (not false)
- Hmm, seems HUDSON_USER is not reliably set. The only 4 I saw reliably
- set were
- [echoproperties] env.HUDSON_COOKIE
- [echoproperties] env.HUDSON_HOME
- [echoproperties] env.HUDSON_SERVER_COOKIE
- [echoproperties] env.HUDSON_URL
- Not sure which would be best/safest to use in huristic, but
- I'll go with URL for now.
- -->
- <property environment="env" />
- <condition property="hudson">
- <isset property="env.HUDSON_URL" />
- </condition>
-
- </target>
-
- <target
- name="hudson-init"
- if="hudson"
- depends="checkHudson">
- <!-- as of this writing, 04/22/2012, this was current list of
- hudson provided variables. We take advantage of a number
- of them, but "translate" them into our own variable names,
- for a little loser build-system seperattion
- BUILD_NUMBER
- The current build number, such as "153"
- BUILD_ID
- The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
- JOB_NAME
- Name of the project of this build, such as "foo"
- BUILD_TAG
- String of "hudson-${JOB_NAME}-${BUILD_NUMBER}". Convenient to put into a resource file, a jar file, etc for easier identification.
- EXECUTOR_NUMBER
- The unique number that identifies the current executor (among executors of the same machine) that's carrying out this build. This is the number you see in the "build executor status", except that the number starts from 0, not 1.
- NODE_NAME
- Name of the slave if the build is on a slave, or "" if run on master
- NODE_LABELS
- Whitespace-separated list of labels that the node is assigned.
- JAVA_HOME
- If your job is configured to use a specific JDK, this variable is set to the JAVA_HOME of the specified JDK. When this variable is set, PATH is also updated to have $JAVA_HOME/bin.
- WORKSPACE
- The absolute path of the workspace.
- HUDSON_URL
- Full URL of Hudson, like http://server:port/hudson/
- BUILD_URL
- Full URL of this build, like http://server:port/hudson/job/foo/15/
- JOB_URL
- Full URL of this job, like http://server:port/hudson/job/foo/
- SVN_REVISION
- For Subversion-based projects, this variable contains the revision number of the module.
- CVS_BRANCH
- For CVS-based projects, this variable contains the branch of the module. If CVS is configured to check out the trunk, this environment variable will not be set.
- HUDSON_USER
- Currently logged in user
- -->
- <property environment="hudson" />
- <property
- name="WORKSPACE"
- value="${hudson.WORKSPACE}" />
- <echo message="Found we are running in hudson and set workspace to ${WORKSPACE}" />
-
- </target>
<target
name="init"
- depends="hudson-init, streamSpecificInit">
+ depends="initWorkspace, initDownloadHosts, initBuildId, initBuildType, initBasicDirectories, initStreamSpecificVariables, initTargetPlatform, initPlatformSpecificProperties, initconfigure.team.cvs.test,setJavaMajorVersion"
+ unless="runTest2Initialized">
- <!-- if not specified on command line, assume files come from 'download.eclipse.org' -->
- <property
- name="DOWNLOAD_HOST"
- value="download.eclipse.org" />
- <property
- name="ARCHIVE_HOST"
- value="archive.eclipse.org" />
-
- <!-- if not otherwise set, such as by hudson-init,
- assume "current directory" for WORKSPACE -->
- <property
- name="WORKSPACE"
- value="${basedir}" />
-
-
- <property
- name="relengBaseBuilderDir"
- value="${WORKSPACE}/org.eclipse.releng.basebuilder" />
<property
- name="eclipseBuilderDir"
- value="${WORKSPACE}/eclipse.platform.releng.aggregator/production/testScripts/configuration" />
-
- <antcall target="initBuildType" />
+ name="EOL"
+ value="${line.separator}" />
<echo message="Variables in 'runTests2.xml'" />
<echo message="DOWNLOAD_HOST: ${DOWNLOAD_HOST}" />
- <echo message="hudson: ${hudson}" />
<echo message="WORKSPACE: ${WORKSPACE}" />
<echo message="buildId: ${buildId}" />
<echo message="relengBaseBuilderDir: ${relengBaseBuilderDir}" />
- <echo message="eclipseBuilderDir: ${eclipseBuilderDir}" />
+ <echo message="configurationDir: ${configurationDir}" />
<echo message="java.home: ${java.home}" />
<echo message="eclipseStream: ${eclipseStream}" />
<echo message="eclipseStreamMajor: ${eclipseStreamMajor}" />
@@ -113,42 +26,18 @@
<echo message="buildType: ${buildType}" />
<property
- name="testDir"
- value="${WORKSPACE}/workarea/${buildId}" />
- <echo message="DEBUG: testDir ${testDir}" />
- <property
- name="executionDir"
- value="${testDir}/eclipse-testing" />
- <mkdir dir="${executionDir}" />
- <echo message="executionDir ${executionDir}" />
-
- <!--
- mostly putting previous platform here, since p2 looks for exactly one
- occurance of "platform-eclipse-" under executionDir, and if it finds two,
- it won't "find" any.
- -->
- <mkdir dir="${executionDir}/platformLocation" />
- <echo message="platformLocation ${platformLocation}" />
-
- <!-- this is later ?attempted? to be set to what is in equinoxp2tests.properties?
- <property
- name="currentbuildrepo"
- value="http://${DOWNLOAD_HOST}/eclipse/updates/${updateSiteSegment}-${buildType}-builds/${buildId}" />
- <echo message="currentbuildrepo: ${currentbuildrepo}" />
--->
- <property
name="buildURL"
value="http://${DOWNLOAD_HOST}/eclipse/downloads/${dropsDirSegment}/${buildId}" />
- <!--
- there's nothing "automatic" about the local cache (so far).
- If specified (such as on hudson command line that executes this
- file, as, say,
- -DlocalCache=file:///shared/eclipse/localCache
- then all the downloads required must be already available there.
- It is intended to speed up local testing to avoid re-downloading
- files.
- -->
+ <!--
+ there's nothing "automatic" about the local cache (so far).
+ If specified (such as on hudson command line that executes this
+ file, as, say,
+ -DlocalCache=file:///shared/eclipse/localCache
+ then all the downloads required must be already available there.
+ It is intended to speed up local testing to avoid re-downloading
+ files.
+ -->
<condition
property="archiveLocation"
value="${localCache}"
@@ -158,27 +47,29 @@
<echo message="buildURL ${buildURL}" />
<echo message="archiveLocation ${archiveLocation}" />
+ <property
+ name="runTest2Initialized"
+ value="true" />
+
</target>
<target
- name="platformIndependentZips"
+ name="getPlatformIndependentZips"
unless="skipInstall">
<get
retries="5"
- verbose="true"
src="${archiveLocation}/eclipse-Automated-Tests-${buildId}.zip"
dest="${testDir}/eclipse-Automated-Tests-${buildId}.zip" />
<get
retries="5"
- verbose="true"
src="${archiveLocation}/eclipse-${buildId}-delta-pack.zip"
dest="${executionDir}/eclipse-${buildId}-delta-pack.zip" />
</target>
<target
name="getwinzips"
- depends="platformIndependentZips"
+ depends="getPlatformIndependentZips"
unless="skipInstall">
<get
src="${archiveLocation}/eclipse-SDK-${buildId}-win32.zip"
@@ -192,7 +83,7 @@
</target>
<target
name="getwinzips64"
- depends="platformIndependentZips"
+ depends="getPlatformIndependentZips"
unless="skipInstall">
<get
src="${archiveLocation}/eclipse-SDK-${buildId}-win32-x86_64.zip"
@@ -206,7 +97,7 @@
</target>
<target
name="getlinzips"
- depends="platformIndependentZips"
+ depends="getPlatformIndependentZips"
unless="skipInstall">
<get
src="${archiveLocation}/eclipse-SDK-${buildId}-linux-gtk-x86_64.tar.gz"
@@ -221,7 +112,7 @@
<target
name="getlinzips32"
- depends="platformIndependentZips"
+ depends="getPlatformIndependentZips"
unless="skipInstall">
<get
src="${archiveLocation}/eclipse-SDK-${buildId}-linux-gtk.tar.gz"
@@ -236,7 +127,7 @@
<target
name="getmaczips"
- depends="platformIndependentZips"
+ depends="getPlatformIndependentZips"
unless="skipInstall">
<get
src="${archiveLocation}/eclipse-SDK-${buildId}-macosx-cocoa.tar.gz"
@@ -251,7 +142,7 @@
<target
name="getmacosx"
- depends="platformIndependentZips"
+ depends="getPlatformIndependentZips"
unless="skipInstall">
<get
src="${archiveLocation}/eclipse-SDK-${buildId}-macosx-cocoa-x86_64.tar.gz"
@@ -265,7 +156,7 @@
</target>
<target
- name="configure.team.cvs.test"
+ name="initconfigure.team.cvs.test"
depends="computeExpectedLocation,getcvstestProperties" />
<target name="computeExpectedLocation">
@@ -294,25 +185,14 @@
<target
name="getcvstestProperties"
if="cvsPropertiesAvailable"
- depends="computeExpectedLocation,checkCVSPropExists,logNoExistence">
+ depends="computeExpectedLocation,checkCVSPropExists,logNoExistence"
+ unless="cvstestPropertiesInitialized">
<echo message="cvstest.properties file: ${cvstest.properties}" />
- <replace
- file="${executionDir}/test.xml"
- propertyFile="${cvstest.properties}">
- <replacefilter
- token="${cvs_user}"
- property="cvs_user" />
- <replacefilter
- token="${cvs_password}"
- property="cvs_password" />
- <replacefilter
- token="${cvs_host}"
- property="cvs_host" />
- <replacefilter
- token="${cvs_root}"
- property="cvs_root" />
- </replace>
+ <property file="${cvstest.properties}" />
+ <property
+ name="cvstestPropertiesInitialized"
+ value="true" />
</target>
@@ -330,16 +210,10 @@
<echo message="cvs properties file was not found in this environment. " />
<echo message=" expected file: ${cvstest.properties} " />
</target>
- <target
- name="runTests2"
- depends="init">
- <echo message="DEBUG: echoproperties at start of main runTests2.xml (after inits)" />
- <echoproperties />
- <property
- name="test.xml"
- value="${WORKSPACE}/sdk.tests/testScripts/runTests.xml" />
-
+ <target
+ name="initTargetPlatform"
+ unless="testPlatform">
<condition
property="testPlatform"
value="win7-64">
@@ -433,6 +307,10 @@
</condition>
<echo message="os ws arch ${osgi.os} ${osgi.ws} ${osgi.arch}" />
<echo message="testPlatform ${testPlatform}" />
+ </target>
+
+ <target name="downloadTargetPlatform">
+ <!-- TODO: should add checks for checksum integrity on downloads. Perhaps use mirror URLs? (though, that'd not effect production) -->
<fail
unless="testPlatform"
message="testPlatform did not match any of the supported combinations of osgi.os, osgi.ws, osgi.arch" />
@@ -481,119 +359,198 @@
<echo message="getArtifacts ${getArtifacts}" />
<antcall target="${getArtifacts}" />
- <!--
- Try using "loadproperties", insstead of "properties file=" to see if
- that will "evaluate" variables as loaded. Otherwise, the <properties form
- has to move to "top of file" ... outer scope?
- <property file="${eclipseBuilderDir}/eclipse/buildConfigs/sdk.tests/testConfigs/${testPlatform}/testing.properties" />
- -->
+ </target>
+
+ <target
+ name="initPlatformSpecificProperties"
+ depends="initTargetPlatform"
+ unless="platformSpecificPropertiesInitialized">
<property
- name="testingPropertiesfile"
- value="${eclipseBuilderDir}/sdk.tests/testConfigs/${testPlatform}/testing.properties" />
+ name="configurationDir"
+ value="${WORKSPACE}/eclipse.platform.releng.aggregator/production/testScripts/configuration" />
+ <property
+ name="platformSpecificProperties"
+ value="${configurationDir}/sdk.tests/testConfigs/${testPlatform}/platformSpecific.properties" />
<loadproperties>
- <file file="${testingPropertiesfile}" />
+ <file file="${platformSpecificProperties}" />
</loadproperties>
+ <property
+ name="platformSpecificPropertiesInitialized"
+ value="true" />
- <echo message="DEBUG: testingPropertiesfile: ${testingPropertiesfile}" />
- <echo message="buildId: ${buildId}" />
-<!--
- <property
- name="tester"
- value="${executionDir}" />
--->
- <echo message="DEBUG: testDir: ${testDir}" />
- <echo message="DEBUG: executionDir: ${executionDir}" />
-
- <!--if executiondir starts with c:\ you'll need to escape it so it can load the filename properly with java
- <pathconvert
- targetos="unix"
- property="windowsfile">
- <path location="${executionDir}" />
- </pathconvert>
- <echo message="windowsfile ${windowsfile}" />
- <property
- name="p2executionDir"
- value="${windowsfile}" />
- -->
- <!--
- <replace
- file="${eclipseBuilderDir}/sdk.tests/testConfigs/${testPlatform}/equinoxp2tests.properties"
- token="@executionDir@"
- value="${p2executionDir}" />
- <replace
- file="${eclipseBuilderDir}/sdk.tests/testConfigs/${testPlatform}/equinoxp2tests.properties"
- token="@buildId@"
- value="${buildId}" />
- <replace
- file="${eclipseBuilderDir}/sdk.tests/testConfigs/${testPlatform}/equinoxp2tests.properties"
- token="@org.eclipse.equinox.p2.tests.current.build.repo@"
- value="${currentbuildrepo}" />
- -->
-
- <!--
- <loadproperties srcfile="${eclipseBuilderDir}/sdk.tests/testConfigs/${testPlatform}/equinoxp2tests.properties" />
- -->
+ </target>
- <echo message="executionDir ${executionDir}" />
+ <target
+ name="runTests2"
+ depends="init, downloadTargetPlatform">
<copy
todir="${executionDir}"
verbose="true">
- <fileset dir="${eclipseBuilderDir}/sdk.tests/testConfigs/${testPlatform}" />
+ <fileset dir="${configurationDir}/sdk.tests/testConfigs/${testPlatform}" />
</copy>
<copy
verbose="true"
todir="${executionDir}"
overwrite="true">
- <fileset dir="${eclipseBuilderDir}/sdk.tests/testScripts" />
+ <fileset dir="${configurationDir}/sdk.tests/testScripts" />
</copy>
- <antcall target="configure.team.cvs.test" />
- <echo message="test.xml: ${test.xml}" />
- <echo message="Echo Properties in runTest2, right before calling test.xml: ${test.xml}" />
<echoproperties
- destfile="${WORKSPACE}/productionFromRunTest2.properties" />
- <ant antfile="${test.xml}">
- </ant>
+ description="Echo all properties in runTest2 after all is initialized, shortly before tests are ran."
+ destfile="${WORKSPACE}/propertiesAllFromRunTest2.properties" />
+ <!--
+ TODO: seems this unzip could/should be moved to test.xml? To do once only,
+ of course, if not already done.
+ We (sort of) do in test.xml. See its setupRepo task.
+-->
+ <property
+ name="repoZip"
+ value="${executionDir}/eclipse-junit-tests-${buildId}.zip" />
+ <echo message="repoZip: ${repoZip}" />
+ <antcall target="unzipTestFramework" />
+
+ <!--
+ We print these properties to a file primarily to capture variables that
+ might have been set in Hudson, which do not "survive" going through the
+ bat or script files. ... Though, makes me wonder if we really need to do that?
+ Seems we could call test.xml directly?
+ In principle, we could call printProperty from anywhere,
+ but seems best to centralize the function.
+ -->
+ <antcall target="printProductionProperties" />
+
+ <!--
+ The PHP properties are useful to display (directly or indirectly)
+ on "test results" page (such as "testPlatform" headings).
+ -->
+ <antcall target="printMainPropertiesAsPHP" />
+
+ <!--
+ following are all required by "runtests" ... used to be part of it, but wanted these
+ variables to print out, even if merely testing scripts, but not actually running tests.
+ -->
+ <condition
+ property="executionArguments"
+ value="/c ${testScript}">
+ <and>
+ <os family="windows" />
+ </and>
+ </condition>
+ <property
+ name="executionArguments"
+ value="${testScript}" />
+
+ <echo message="=== properties for runTests executable:" />
+ <echo message=" = properties used in exec task:" />
+ <echo message=" executionDir ${executionDir}" />
+ <echo message=" testExecutable ${testExecutable}" />
+ <echo message=" testScript ${testScript}" />
+ <echo message=" executionArguments ${executionArguments}" />
+ <echo message=" = properties set as env variables:" />
+ <echo message=" propertiesFile: ${WORKSPACE}/production.properties" />
+ <echo message=" jvm: ${jvm}" />
+ <echo message=" testedPlatform: ${testedPlatform}" />
+
+ <antcall target="runtests" />
</target>
- <!--
- This streamSpecificInit target was copied from buildAll.xml and does about exactly the same thing,
- purposely left close to original, though not as much is actually required.
- TODO: in future, pull out into one file, and reuse
+ <target
+ name="printProductionProperties"
+ depends="init">
+ <!--
+ here we want to print properties, such as passed in via Hudson,
+ that can be used later, by test.xml, but since it is started by as seperate
+ processes, there is no direct access to Hudson properties ...
+ so we make them persistent. In many cases, the property will not be defined,
+ in which case we do not want to write anythng for that property (or, it
+ will appear to have been set, even if set to an empty string).
+ -->
- Its purpose, here, is entirely to pick up "stream specific" stings from the releng maps
- project, 'configuration' folder.
+ <printProperty property="buildId" />
+ <printProperty property="buildType" />
+ <printProperty property="eclipseStream" />
+ <printProperty property="previousReleaseVersion" />
+ <printProperty property="osgi.os" />
+ <printProperty property="osgi.ws" />
+ <printProperty property="osgi.arch" />
+ <printProperty property="DOWNLOAD_HOST" />
+ <printProperty property="ARCHIVE_HOST" />
+ <printProperty property="executionDir" />
+ <printProperty property="configurationDir" />
+ <printProperty property="args" />
+ <printProperty property="skipDerby" />
+ <printProperty property="test.target" />
+ <printProperty property="testExecutable" />
+ <printProperty property="testScript" />
+ <printProperty property="jvm" />
+ <printProperty property="javaversionEscaped" />
+ <printProperty property="javaMajorVersion" />
+ <printProperty property="testedPlatform" />
+ <!--
+ The following will leave pw in file, which is not a lot different that
+ leave them printed in log, as we also do. But, could be improved by just leaving
+ filename in properties, and reading them in at the time needed in test.xml.
+ -->
+ <printProperty property="cvstest.properties" />
- Important note: here, unlike the one in buildAll.xml, we assume the maps have already
- been checked out, say by hudson, as a peer of eclipseBuilder, rather then us doing
- the checkout here, ourselves. Not sure which is easier, but current means hudson job
- has to be set up with two git checkout steps, right version for maps (for 3.8 vs 4.2).
+ </target>
- -->
- <target
- name="streamSpecificInit"
- unless="streamSpecificInitComplete"
- depends="initBuildType, initStreamVariables,hudson-init">
- <echo message="DEBUG: executing streamSpecificInit" />
+ <macrodef name="printProperty">
+ <!-- the use of properyfile and local require at least Ant 1.8 -->
+ <attribute name="property" />
+ <sequential>
+ <echo message="DEBUG @{property}: ${@{property}}" />
+ <!--
+ for our use, 'del' operation won't typcially delete anything,
+ since would not have been there to begin with, but is an easy way to
+ prevent an undefined property from being written
+ -->
+ <local name="oper" />
+ <condition
+ property="oper"
+ value="="
+ else="del">
+ <isset property="@{property}" />
+ </condition>
+ <propertyfile file="${WORKSPACE}/production.properties">
+ <entry
+ key="@{property}"
+ value="${@{property}}"
+ operation="${oper}" />
+ </propertyfile>
+ </sequential>
+ </macrodef>
- <!-- if not specified on command line, assume files come from 'download.eclipse.org' -->
- <property
- name="DOWNLOAD_HOST"
- value="download.eclipse.org" />
- <property
- name="ARCHIVE_HOST"
- value="archive.eclipse.org" />
- <property
- name="configurationLocation"
- value="${WORKSPACE}/eclipse.platform.releng.aggregator/production/testScripts/configuration" />
+ <!--
+ This initStreamSpecificVariables target was copied from buildAll.xml and does about exactly the same thing,
+ purposely left close to original, though not as much is actually required.
+ TODO: in future, pull out into one file, and reuse
+ You can tell from comment, it is outdated.
+
+ Its purpose, here, is entirely to pick up "stream specific" stings from the releng maps
+ project, 'configuration' folder.
+
+ Important note: here, unlike the one in buildAll.xml, we assume the maps have already
+ been checked out, say by hudson, as a peer of eclipseBuilder, rather then us doing
+ the checkout here, ourselves. Not sure which is easier, but current means hudson job
+ has to be set up with two git checkout steps, right version for maps (for 3.8 vs 4.2).
+ -->
+ <target
+ name="initStreamSpecificVariables"
+ unless="initStreamSpecificVariablesComplete"
+ depends="initWorkspace,initBuildType, initStreamVariables,initDownloadHosts">
+ <echo message="DEBUG: executing initStreamSpecificVariables" />
<!--
these condidtions used to be in "init". Conceptually seems right to be in "stream
- specific" init (since their value depends on stream) but may have side effects?)
+ specific" init (since their value depends on stream) but may have side effects?).
+ This is really no longer relevent, as everythign we build/tests comes from
+ "drops4" ... but will leave in case we ever have a "drops5" ... or, have to
+ back port tests to re-test 3.8! (Which, we propably do, for 3.8?)
-->
<condition
property="dropsDirSegment"
@@ -604,46 +561,67 @@
arg2="4" />
</condition>
- <copy
- verbose="true"
- failonerror="true"
- todir="${WORKSPACE}"
- overwrite="true">
- <fileset dir="${configurationLocation}/">
- <include name="**" />
- </fileset>
- </copy>
-
-
- <!-- The reading/loading of the these streamSpecific-build.properties
- is critical to several stream specific areas of code, so may have to be moved
- "earlier"? Made it own task for depends on clauses? -->
- <loadproperties srcFile="${WORKSPACE}/streamSpecific-build.properties" />
+ <loadproperties srcFile="${configurationDir}/streamSpecific.properties" />
- <!-- echo a few typically expected properties, to make sure getting right file -->
+ <!-- echo a few typically expected properties, to make sure getting right file -->
<echo message="streamSpecificPropertiesTitle: ${streamSpecificPropertiesTitle}" />
<echo message="apiTestsPreviousBaseDLBaseURL: ${apiTestsPreviousBaseDLBaseURL}" />
<echo message="apiTestsPreviousBaseWin32Filename: ${apiTestsPreviousBaseWin32Filename}" />
-<!-- now that we have maps (and we already have eclipseBuider from
- masterBuild.sh, before calling buildAll.xml, then now its time to "overlay"
- the stream specific files of eclipseBuild that are in the maps project, in
- the folder named /org.eclipse.releng/configuration/eclipseBuilderOverlays -->
-<!-- TODO: semi hard code for now, figure out variables later maybe
- do away with "supportDir" segment? maybe call 'base' and other variables
- 'eclipsebulder.base'? -->
-
<property
- name="eclipseBuilderDir"
- value="${WORKSPACE}/eclipse.platform.releng.aggregator/production/testScripts/configuration" />
-
- <property
- name="streamSpecificInitComplete"
+ name="initStreamSpecificVariablesComplete"
value="true" />
</target>
+ <!--
+ DOWNLOAD_HOST and ARCHIVE_HOST can be defined on command line,
+ if running on local test environments.
+ -->
+ <target
+ name="initDownloadHosts"
+ unless="DOWNLOAD_HOST">
+ <!-- we assume if "DOWNLOAD_HOST" is defined, then ARCHIVE_HOST has been defined also. -->
+ <property environment="env" />
+ <echo message="DEBUG: Found DOWNLOAD_HOST not defined. Setting in 'initDownloadHosts'" />
+ <echo message="DEBUG: env.DOWNLOAD_HOST: ${env.DOWNLOAD_HOST}" />
+ <condition
+ property="DOWNLOAD_HOST"
+ value="${env.DOWNLOAD_HOST}"
+ else="download.eclipse.org">
+ <isset property="env.DOWNLOAD_HOST" />
+ </condition>
+ <condition
+ property="ARCHIVE_HOST"
+ value="${env.ARCHIVE_HOST}"
+ else="archive.eclipse.org">
+ <isset property="env.ARCHIVE_HOST" />
+ </condition>
+ </target>
+
+ <target
+ name="initWorkspace"
+ unless="WORKSPACE">
+ <property environment="env" />
+ <condition
+ property="WORKSPACE"
+ value="${env.WORKSPACE}"
+ else="${basedir}">
+ <isset property="env.WORKSPACE" />
+ </condition>
+ </target>
+
+
+ <target
+ name="initBuildId"
+ unless="buildId">
+ <!--property file that can contain the buildId, if not otherwise set -->
+ <property file="label.properties" />
+ <fail
+ unless="buildId"
+ message="buildId (e.g I20140731-0800) needs to be provided to run the tests" />
+ </target>
<target name="initBuildType">
@@ -664,12 +642,14 @@
unless="buildIdOK" />
<script language="javascript">
+ <![CDATA[
var buildId = project.getProperty("buildId");
var pattern = new RegExp(/^([IMXYNPSR])(\d{8})-(\d{4})$/);
var sArray = pattern.exec(buildId);
// sArray 0 is "whole match"
project.setProperty("buildType", sArray[1]);
+ ]]>
</script>
@@ -679,7 +659,10 @@
main purpose of initStreamVariables, it to be sure we have eclipseStreamMajor and eclipseStreamMinor
Uses script, which requires Java 1.6 (or ... else gets complicated to setup)
-->
- <target name="initStreamVariables">
+ <target
+ name="initStreamVariables"
+ unless="streamVariablesInitialized">
+ <property file="${configurationDir}/streamSpecific-build.properties" />
<fail
unless="eclipseStream"
message="eclipseStream value must be provided by caller, such as '4.3' or '4.4.2." />
@@ -693,25 +676,20 @@
unless="streamOK" />
<script language="javascript">
+ <![CDATA[
var eclipseStream = project.getProperty("eclipseStream");
var pattern = new
RegExp(/(\d+)\.(\d+)(\.(\d+))?/);
-
var sArray = pattern.exec(eclipseStream);
// sArray[0] is "whole match"
project.setProperty("eclipseStreamMajor", sArray[1]);
project.setProperty("eclipseStreamMinor", sArray[2]);
- // we don't
- // currently worry about eclipseStreamService, since
- // not currently used, but if needed, it will sometimes be
- // present, and
- // sometiems not. We can assume "0" when not,
- // but we'd have to check length of array so we would know
- // that to assume/assign
- // based on if provided, or not.
- // project.setProperty("eclipseStreamService", sArray[3]);
- project.setProperty("updateSiteSegment", sArray[1] + "." +
- sArray[2]);
+ // zero based: index 3 is 4th item, etc, and we have digit only in a nested group (due to optional)
+ if (sArray.length > 4) {
+ project.setProperty("eclipseStreamService", sArray[4]);
+ }
+ project.setProperty("updateSiteSegment", sArray[1] + "." + sArray[2]);
+ ]]>
</script>
<fail
@@ -720,15 +698,516 @@
<fail
unless="eclipseStreamMinor"
message="eclipseStreamMinor not defined or computable" />
- <!--
- <fail
- unless="eclipseStreamService"
- message="eclipseStreamService not defined or computable" />
+ <!-- eclipseStreamService may not always be defined? And we do not currently use it.
+ <fail
+ unless="eclipseStreamService"
+ message="eclipseStreamService not defined or computable" />
-->
<fail
unless="updateSiteSegment"
message="updateSiteSegment not defined or computable" />
+ <property
+ name="streamVariablesInitialized"
+ value="true" />
</target>
+ <target
+ name="initBasicDirectories"
+ depends="initWorkspace,initBuildId,initPlatformSpecificProperties,setJavaMajorVersion"
+ unless="basicDirectoriesInitialized">
+
+ <!-- <property environment="env" /> -->
+
+ <property
+ name="relengBaseBuilderDir"
+ value="${WORKSPACE}/org.eclipse.releng.basebuilder" />
+ <property
+ name="configurationDir"
+ value="${WORKSPACE}/eclipse.platform.releng.aggregator/production/testScripts/configuration" />
+
+ <property
+ name="testDir"
+ value="${WORKSPACE}/workarea/${buildId}" />
+ <echo message="testDir: ${testDir}" />
+
+ <property
+ name="executionDir"
+ value="${testDir}/eclipse-testing" />
+ <mkdir dir="${executionDir}" />
+ <echo message="executionDir: ${executionDir}" />
+
+ <property
+ name="testedPlatform"
+ value="${osgi.os}.${osgi.ws}.${osgi.arch}_${javaMajorVersion}" />
+
+ <!-- The directory that will contain all files containing information on the tests that ran.-->
+ <property
+ name="results"
+ value="${executionDir}/results" />
+
+ <mkdir dir="${results}" />
+ <mkdir dir="${results}/xml" />
+ <mkdir dir="${results}/html" />
+ <echo message="results: ${results}" />
+
+
+ <!--Directory for JUnit report output, console log output and .log content for each test suite.
+ Overrides default in org.eclipse.test/library.xml-->
+ <property
+ name="junit-report-output"
+ value="${results}/${testedPlatform}" />
+ <mkdir dir="${junit-report-output}" />
+ <echo message="junit-report-output: ${junit-report-output}" />
+
+ <!--default directory where test-eclipse-sdk will be installed-->
+ <property
+ name="install"
+ value="${executionDir}/test-eclipse" />
+ <mkdir dir="${install}" />
+ <echo message="install: ${install}" />
+
+
+ <!-- The root of the eclipse installation -->
+ <property
+ name="eclipse-home"
+ value="${install}/eclipse" />
+ <mkdir dir="${eclipse-home}" />
+ <echo message="eclipse-home: ${eclipse-home}" />
+
+ <property
+ name="repoLocation"
+ value="${executionDir}/testRepo" />
+ <echo message="repoLocation: ${repoLocation}" />
+
+ <!--
+ mostly putting previous platform here, since p2 looks for exactly one
+ occurance of "platform-eclipse-" under executionDir, and if it finds two,
+ it won't "find" any.
+ -->
+ <property
+ name="platformLocation"
+ value="${executionDir}/platformLocation" />
+ <mkdir dir="${platformLocation}" />
+ <echo message="platformLocation: ${platformLocation}" />
+
+
+
+
+
+
+ <property
+ name="directorLogs"
+ value="${executionDir}/directorLogs" />
+ <mkdir dir="${directorLogs}" />
+ <echo message="directorLogs: ${directorLogs}" />
+
+ <!-- this dirctory, with some sort files are created during unit tests
+ ... need to find where to disable/enable jacoco -->
+ <property
+ name="coverage-output"
+ value="${results}/coverageIGNORE" />
+
+ <property
+ name="basicDirectoriesInitialized"
+ value="true" />
+ <echo message="basicDirectoriesInitialized" />
+ </target>
+
+ <!--
+ This task unzips the test framework that was built.
+ It includes misc. files, the Test Framework proper, and
+ a zipped up repo of the unit tests.
+ We also do this in "testAll" scripts ...?
+ TODO: investigate how to avoid doing there, if already done.
+ -->
+ <target name="unzipTestFramework">
+ <fail unless="testDir" />
+ <fail unless="buildId" />
+
+ <property
+ name="testResults"
+ value="${testDir}/testresults" />
+ <property
+ name="testFramework"
+ value="${testDir}/eclipse-Automated-Tests-${buildId}.zip" />
+
+ <condition property="testFrameworkExists">
+ <available file="${testFramework}" />
+ </condition>
+ <fail unless="testFrameworkExists" />
+
+ <echo message="testFramework: ${testFramework}" />
+ <echo message="testDir: ${testDir}" />
+ <echo message="testResults: ${testResults}" />
+
+ <!--set up testing directory-->
+ <unzip
+ src="${testFramework}"
+ dest="${testDir}"
+ overwrite="false">
+ <patternset>
+ <exclude name="**/equinoxp2tests.properties" />
+ <exclude name="**/test.xml" />
+ </patternset>
+ </unzip>
+ </target>
+
+ <target
+ name="runtests"
+ depends="init"
+ unless="env.TESTING_TEST_XML">
+
+ <!--run the tests-->
+ <exec
+ dir="${executionDir}"
+ executable="${testExecutable}">
+ <arg line="${executionArguments}" />
+ <!-- TODO: args comes all the way from Hudson. Should be renamed "testSuites" or similar. -->
+ <arg value="${args}" />
+ <env
+ key="propertyFile"
+ file="${WORKSPACE}/production.properties" />
+ <env
+ key="jvm"
+ file="${jvm}" />
+ <env
+ key="testedPlatform"
+ value="${testedPlatform}" />
+ </exec>
+ </target>
+
+ <!--
+ Prints properties in "PHP form" to use on test results summary,
+ to be sure accurate and meaningful.
+ -->
+ <target
+ name="printMainPropertiesAsPHP"
+ depends="init"
+ unless="printedMainPHPProperties">
+
+ <property
+ name="EOL"
+ value="${line.separator}" />
+
+
+ <property
+ name="phpPropertyFile"
+ value="${junit-report-output}/testProperties.php" />
+
+ <!-- on first write to php file, don't append -->
+ <echo
+ message="&lt;?php${EOL}"
+ append="false"
+ file="${phpPropertyFile}" />
+ <escapeProperty property="ant.version" />
+ <printPHPProperty
+ phpvar="ANT_VERSION"
+ value="ant.versionEscaped" />
+ <printPHPProperty
+ phpvar="ANT_JAVA_VERSION"
+ value="ant.java.versionEscaped" />
+ <printPHPProperty
+ phpvar="INVOKED_JAVA_VERSION"
+ value="javaversionEscaped" />
+ <!--
+ Note: there might be times, the java.runtime.version at this point in time,
+ may not be quite right ... such as if invoked with some other VM with the intent of
+ using 'jvm' on "eclipse" command line ... which we currently do not do.
+ -->
+ <printPHPProperty
+ phpvar="JAVA_VERSION"
+ value="java.version" />
+ <printPHPProperty
+ phpvar="JAVA_MAJOR_VERSION"
+ value="javaMajorVersion" />
+ <printPHPProperty
+ phpvar="JAVA_RUNTIME_VERSION"
+ value="java.runtime.version" />
+ <printPHPProperty
+ phpvar="JAVA_VM_INFO"
+ value="java.vm.info" />
+ <printPHPProperty
+ phpvar="JAVA_SPECIFICATION_VERSION"
+ value="java.specification.version" />
+ <printPHPProperty
+ phpvar="JAVA_VENDOR"
+ value="java.vendor" />
+ <printPHPProperty
+ phpvar="OSGI_OS"
+ value="osgi.os" />
+ <printPHPProperty
+ phpvar="OSGI_WS"
+ value="osgi.ws" />
+ <printPHPProperty
+ phpvar="OSGI_ARCH"
+ value="osgi.arch" />
+ <!-- NODE_NAME will be empty string, if on master -->
+ <condition
+ property="hudsonSlave"
+ value="master">
+ <or>
+ <not>
+ <isset property="env.NODE_NAME" />
+ </not>
+ <equals
+ arg1="${env.NODE_NAME}"
+ arg2="" />
+ <equals
+ arg1="${env.NODE_NAME}"
+ arg2=" " />
+ </or>
+ </condition>
+ <!-- if not set above, we'll set to the non blank NODE_NAME -->
+ <property
+ name="hudsonSlave"
+ value="${env.NODE_NAME}" />
+
+ <printPHPProperty
+ phpvar="HUDSON_NODE_NAME"
+ value="hudsonSlave" />
+ <!--
+ I believe all (common) platforms have env variable for HOSTNAME.
+ If not, user might want to set/export to be meaningful.
+ (Surprisingly, it doesn't seem obvious that Hudson makes this available
+ in its process environment).
+ -->
+ <printPHPProperty
+ phpvar="HOSTNAME"
+ value="env.HOSTNAME" />
+ <printPHPProperty
+ phpvar="HUDSON_JOB_NAME"
+ value="env.JOB_NAME" />
+ <printPHPProperty
+ phpvar="HUDSON_BUILD_NUMBER"
+ value="env.BUILD_NUMBER" />
+ <printPHPProperty
+ phpvar="HUDSON_BUILD_URL"
+ value="env.BUILD_URL" />
+ <!--
+ With HUDSON_URL and WORKSPACE_PATH should be able
+ to figure out URL to WORKSPACE, though only temporarily
+ available (until next job is ran).
+ -->
+ <printPHPProperty
+ phpvar="HUDSON_URL"
+ value="env.HUDSON_URL" />
+ <printPHPProperty
+ phpvar="HUDSON_WORKSPACE"
+ value="env.WORKSPACE" />
+
+ <!--
+ We end with an empty line, but it is recommended to not
+ end included PHP files with "end PHP" marker.
+ -->
+ <echo
+ message="${EOL}"
+ append="true"
+ file="${phpPropertyFile}" />
+
+ <!-- set property so we only print these variables once -->
+ <property
+ name="printedMainPHPProperties"
+ value="true" />
+
+ </target>
+ <target
+ name="setJVMProperties"
+ depends="initPlatformSpecificProperties,setJVMfromUserSpecified"
+ unless="jvm">
+ <property
+ name="VMSource"
+ value="VM used for tests, is same that invoked Ant: '${java.home}/bin/java' (that is, 'jvm' not specified by caller)." />
+ <echo message="VMSource: ${VMSource}" />
+ <!--
+ Remember, we don't want J2SE-X.0 set at all, if there is nothing
+ that can run tests that require that level.
+ -->
+ <property
+ name="jvm"
+ value="${java.home}/bin/java" />
+
+ <exec
+ executable="${jvm}"
+ outputproperty="javaversion">
+ <arg line="-version" />
+ </exec>
+ <echo message="full output from 'java -version' of ${jvm} is " />
+ <echo message="${javaversion}" />
+ <escapeProperty property="javaversion" />
+ <echo message="full output from 'java -version' of ${jvm} is " />
+ <echo message="${javaversionEscaped}" />
+
+ <!--enable tests requiring 1.5 or or greater vms to run if running vm level detected matches required execution environment-->
+ <condition
+ property="J2SE-8.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[8]' />
+ </condition>
+ <condition
+ property="J2SE-7.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[78]' />
+ </condition>
+ <condition
+ property="J2SE-6.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[678]' />
+ </condition>
+ <condition
+ property="J2SE-5.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[5678]' />
+ </condition>
+ <echo
+ level="info"
+ message="DEBUG: values from setJVMfromUserSpecified" />
+ <echo message="J2SE-8.0: ${J2SE-8.0}" />
+ <echo message="J2SE-7.0: ${J2SE-7.0}" />
+ <echo message="J2SE-6.0: ${J2SE-6.0}" />
+ <echo message="J2SE-5.0: ${J2SE-5.0}" />
+ </target>
+ <target
+ name="setJVMfromUserSpecified"
+ if="jvm"
+ unless="javaversionEscaped">
+
+ <property
+ name="VMSource"
+ value="VM used for tests, specified by caller: 'jvm'=${jvm}" />
+ <echo message="VMSource: ${VMSource}" />
+ <!--
+ Remember, we don't want J2SE-X.0 set at all, if there is nothing
+ that can run tests that require that level.
+ -->
+ <exec
+ executable="${jvm}"
+ outputproperty="javaversion">
+ <arg line="-version" />
+ </exec>
+ <echo message="full output from 'java -version' of ${jvm} is " />
+ <echo message="${javaversion}" />
+ <escapeProperty property="javaversion" />
+ <echo message="full output from 'java -version' of ${jvm} is " />
+ <echo message="${javaversionEscaped}" />
+
+ <condition
+ property="J2SE-8.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[8]' />
+ </condition>
+ <condition
+ property="J2SE-7.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[78]' />
+ </condition>
+ <condition
+ property="J2SE-6.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[678]' />
+ </condition>
+ <condition
+ property="J2SE-5.0"
+ value="${jvm}">
+ <matches
+ string="${javaversionEscaped}"
+ pattern='^.*java version .*1\.[5678]' />
+ </condition>
+ <echo
+ level="info"
+ message="DEBUG: values from setJVMfromUserSpecified" />
+ <echo message="J2SE-8.0: ${J2SE-8.0}" />
+ <echo message="J2SE-7.0: ${J2SE-7.0}" />
+ <echo message="J2SE-6.0: ${J2SE-6.0}" />
+ <echo message="J2SE-5.0: ${J2SE-5.0}" />
+ </target>
+ <!--
+ function to centralize how we get (that is, set) the value of
+ 'javaMajorVersion'. (expected to be integter, such as 5,6,7,8,9,
+ or will be "0" if the version could not be determined, for some reason.
+ -->
+
+ <target
+ name="setJavaMajorVersion"
+ depends="setJVMProperties"
+ unless="javaMajorVersion">
+
+ <echo message="javaversion in setJavaMajorVersion: ${javaversionEscaped}" />
+ <script language="javascript">
+
+ <!--
+ technically does not have to be wrapped in "CDATA" (Ant and BSD define
+ it that way, but if not done, other tools (such as XML Editor) can
+ break the code by changing the formatting.
+ -->
+ <![CDATA[
+ var javaVer = project.getProperty("javaversionEscaped");
+ var pattern = new RegExp(/^.*1\.([456789]\.\d)/);
+ var sArray = pattern.exec(javaVer);
+ // sArray 0 is "whole match"
+ // so can always exist if any match,
+ // but can be null if no match?
+ // For safety from programing
+ // errors, we'll check for null and length
+ if (sArray != null) {
+ var length = sArray.length;
+ if (length > 1) {
+ project.setProperty("javaMajorVersion", sArray[1]);
+ } else {
+ project.setProperty("javaMajorVersion", "0");
+ }
+ }
+ ]]>
+ </script>
+ </target>
+
+ <macrodef name="printPHPProperty">
+ <attribute name="phpvar" />
+ <attribute name="value" />
+ <sequential>
+ <!-- DEBUG <echo message="@{value}" /> -->
+ <condition
+ property="printValue@{value}"
+ value="${@{value}}"
+ else="NotSet">
+ <isset property="@{value}" />
+ </condition>
+ <echo
+ message="$@{phpvar}=&quot;${printValue@{value}}&quot;;${EOL}"
+ file="${phpPropertyFile}"
+ append="true" />
+ </sequential>
+ </macrodef>
+ <macrodef name="escapeProperty">
+ <!-- the use of properyfile and local require at least Ant 1.8 -->
+ <attribute name="property" />
+ <sequential>
+ <echo message="DEBUG @{property}: ${@{property}}" />
+ <loadresource property="@{property}Escaped">
+ <propertyresource name="@{property}" />
+ <filterchain>
+ <tokenfilter>
+ <filetokenizer />
+ <replacestring
+ from='"'
+ to='\"' />
+ </tokenfilter>
+ </filterchain>
+ </loadresource>
+ </sequential>
+ </macrodef>
</project>

Back to the top