diff options
author | Sravan Kumar Lakkimsetti | 2019-12-09 11:10:42 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2019-12-09 11:13:37 +0000 |
commit | 58494359887132e40fe1d90f77a781b6ad013327 (patch) | |
tree | f6f7151a6ccad00549c3b14df1e16363eb57ccd0 /cje-production | |
parent | a837133b585e6d9ccb7dc703f475bf91fb141eb7 (diff) | |
download | eclipse.platform.releng.aggregator-58494359887132e40fe1d90f77a781b6ad013327.tar.gz eclipse.platform.releng.aggregator-58494359887132e40fe1d90f77a781b6ad013327.tar.xz eclipse.platform.releng.aggregator-58494359887132e40fe1d90f77a781b6ad013327.zip |
Bug 553757 - Migrate I-builds to new infraI20191209-1110
Change-Id: I3629bf08cf212c529327a5049a65558557933644
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Diffstat (limited to 'cje-production')
-rw-r--r-- | cje-production/scripts/collectTestResults.xml | 217 |
1 files changed, 217 insertions, 0 deletions
diff --git a/cje-production/scripts/collectTestResults.xml b/cje-production/scripts/collectTestResults.xml new file mode 100644 index 000000000..54eb23dfe --- /dev/null +++ b/cje-production/scripts/collectTestResults.xml @@ -0,0 +1,217 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project + name="collectTestResults" + default="collectTestResults" + basedir="."> + + <!-- example properties. Caller normally provides. --> + <property + name="job" + value="ep4-unit-mac64" /> + <property + name="buildNumber" + value="49" /> + <property + name="buildId" + value="N20121014-2000" /> + <property + name="eclipseStream" + value="4.3.0" /> + <property + name="EBUILDER_HASH" + value="master" /> + + + <target + name="collectTestResults" + depends="init" + description="Collect Test Results from Hudson to build machine location."> + + + <fail unless="buildNumber" /> + + <retry + retrycount="3" + retrydelay="1000"> + <get + ignoreerrors="true" + verbose="true" + src="${hudsonResultURL}" + dest="${tmpzipdir}/archive.zip" /> + </retry> + + <echo message="hudsonTestResultsURL ${hudsonTestResultsURL} " /> + <retry + retrycount="3" + retrydelay="1000"> + <get + src="${hudsonTestResultsURL}" + dest="${resultsDir}/${job}-${buildNumber}.xml" /> + </retry> + + <!-- not sure if mkdir needed? --> + <mkdir dir="${resultsDir}/directorLogs" /> + + <unzip + overwrite="true" + src="${tmpzipdir}/archive.zip" + dest="${resultsDir}/"> + <globmapper + from="archive/workarea/${buildId}/eclipse-testing/results/*" + to="*" /> + </unzip> + + <delete failonerror="false"> + <fileset dir="${resultsDir}"> + <include name="${tmpzipdir}" /> + <include name="archive/**" /> + </fileset> + </delete> + + </target> + + <target + name="init" + unless="collectTestResultsInitialized"> + + <property + name="env.HUDSON_ROOT_URI" + value="releng" /> + + <!-- we set these "env" variables here not to effect the + environment, but that because we need some value for them, + so if not actually set in the environment, we create these + with some reasonable default. (Though, if not set in the environment, + could be a sign that somethign is not as expected?) + --> + <condition + property="hudsonHost" + value="${env.HUDSON_PERF_HOST}"> + <and> + <isset property="HUDSON_PERF_HOST" /> + <contains + string="${job}" + substring="-perf-lin" + casesensitive="yes" /> + </and> + </condition> + <!-- if that didn't set hudsonHost, check env variable before using fallback default --> + <condition + property="hudsonHost" + value="${env.HUDSON_HOST}" + else="ci-staging.eclipse.org"> + <isset property="env.HUDSON_HOST" /> + </condition> + + + <property + name="env.HUDSON_PROTOCOL" + value="https" /> + <property + name="env.HUDSON_PORT" + value="443" /> + + <!-- if not set externally, set to eclipse default (for -perf-lin jobs) --> + <property + name="env.LINUX_PERF_SEGMENT" + value="releng" /> + + <condition + property="hudsonPathSegment" + value="${env.LINUX_PERF_SEGMENT}" + else="${env.HUDSON_ROOT_URI}"> + <and> + <isset property="env.LINUX_PERF_SEGMENT" /> + <contains + string="${job}" + substring="-perf-lin" + casesensitive="yes" /> + </and> + </condition> + + <script language="javascript"><![CDATA[ + var buildId = project.getProperty("buildId"); + var patternbuildType = new RegExp(/^([IMXYNSRU])(\d{8})-(\d{4})$/); + + var sArraybuildType = patternbuildType.exec(buildId); + // sArray 0 is "whole match" + var buildType = sArraybuildType[1]; + project.setProperty("buildType", buildType); + + var eclipseStream = project.getProperty("eclipseStream"); + var patternStream = new RegExp(/(\d+)\.(\d+)\.(\d+)/); + + var sArrayStream = patternStream.exec(eclipseStream); + // sArray[0] is "whole match" + var eclipseStreamMajor = sArrayStream[1]; + var eclipseStreamMinor = sArrayStream[2]; + var eclipseStreamService = sArrayStream[3]; + project.setProperty("eclipseStreamMajor", eclipseStreamMajor); + project.setProperty("eclipseStreamMinor", eclipseStreamMinor); + project.setProperty("eclipseStreamService", eclipseStreamService); + + var buildhome = "/home/data/httpd/download.eclipse.org"; + + var postingDirectory = buildhome + "/eclipse/downloads/drops4" + project.setProperty("postingDirectory", postingDirectory); + ]]> + </script> + + + <echo message="postingDirectory: ${postingDirectory}" /> + + <!-- + Two possible results directories. + All of these asssume following naming conventions in Hudson jobs. TODO: in future could/should have properties + that describe the tests anyway, so might want to use that, to deside results directories.Currently: + contains -perf- : performance + else: testresults + We need to avoid "-baseline" distinction. If anything, + make one base on "LR" (long running). + --> + <condition + property="resultsDir" + value="${postingDirectory}/${buildId}/performance" + else="${postingDirectory}/${buildId}/testresults"> + <contains + string="${job}" + substring="-perf-" + casesensitive="yes" /> + </condition> + + <!-- attempt to create incase hasn't been created yet --> + <mkdir dir="${resultsDir}" /> + + <property + name="hudsonResultRootJobURL" + value="${env.HUDSON_PROTOCOL}://${hudsonHost}:${env.HUDSON_PORT}/${hudsonPathSegment}/job/${job}/${buildNumber}" /> + + + <property + name="hudsonResultRootURL" + value="${hudsonResultRootJobURL}/artifact/*zip*" /> + <property + name="hudsonResultURL" + value="${hudsonResultRootURL}/archive.zip" /> + <echo message="hudsonResultURL ${hudsonResultURL} " /> + + <property + name="hudsonTestResultsURL" + value="${hudsonResultRootJobURL}/testReport/api/xml?tree=failCount,passCount,skipCount,duration" /> + <echo message="hudsonTestResultsURL ${hudsonTestResultsURL} " /> + + <property + name="tmpzipdir" + value="${resultsDir}/tmp${job}" /> + + + + <mkdir dir="${tmpzipdir}" /> + + <property + name="collectTestResultsInitialized" + value="true" /> + + </target> + +</project>
\ No newline at end of file |