From a71ad9cb56e4e9fca824fb553513acaa54ae3f75 Mon Sep 17 00:00:00 2001 From: david_williams <david_williams> Date: Fri, 11 Jan 2008 04:02:52 +0000 Subject: [PATCH] fixes to xsl test infrastructure --- .../distribution/incubator.site/publish.xml | 9 +---- .../staticDropFiles/miscUtil.php | 35 +++++++++++++++---- .../distribution/patches.site/publish.xml | 2 +- .../distribution/wtp.site/publish.xml | 20 +++++++---- .../wtp.site/staticDropFiles/miscUtil.php | 1 - 5 files changed, 43 insertions(+), 24 deletions(-) diff --git a/releng.wtpbuilder/distribution/incubator.site/publish.xml b/releng.wtpbuilder/distribution/incubator.site/publish.xml index 6407c7ae6..17ed5c51d 100644 --- a/releng.wtpbuilder/distribution/incubator.site/publish.xml +++ b/releng.wtpbuilder/distribution/incubator.site/publish.xml @@ -129,13 +129,6 @@ <antcall target="writeData" /> - <mkdir dir="${resultDir}/whatisfixed" /> - <echo - file="${resultDir}/whatisfixed/buglog.html" - append="true"> - what is fixed list is not available yet! - </echo> - <!-- Update timestamp on file to permit overwrite through Ant copy task --> <touch file="${resultingIndex}" /> </target> @@ -161,7 +154,7 @@ --> <property - file="${buildDirectory}/maps/releng/maps/dependencies.properties" /> + file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" /> <!-- create table of test plugin compiles first --> <!-- set isBuildTested to true for the "compile only" results --> diff --git a/releng.wtpbuilder/distribution/incubator.site/staticDropFiles/miscUtil.php b/releng.wtpbuilder/distribution/incubator.site/staticDropFiles/miscUtil.php index 9e472982b..5778a3a7a 100644 --- a/releng.wtpbuilder/distribution/incubator.site/staticDropFiles/miscUtil.php +++ b/releng.wtpbuilder/distribution/incubator.site/staticDropFiles/miscUtil.php @@ -30,12 +30,12 @@ function fileSizeForDisplay($filename) { function displayFileLine($downloadprefix, $filename, $zipfilesize, $fileShortDescription) { - echo "<td align=\"right\" valign=\"top\" width=\"10%\">"; + echo "<td align=\"right\" valign=\"top\" width=\"30%\">"; echo "<a href=\"$downloadprefix$filename\">" . $fileShortDescription . "</a>"; - echo "</td><td align=\"right\" valign=\"top\" width=\"5%\">"; + echo "</td><td align=\"right\" valign=\"top\" width=\"3%\">"; echo $zipfilesize; echo "</td>"; - echo "<td align=\"right\" valign=\"top\" width=\"5%\">"; + echo "<td align=\"right\" valign=\"top\" width=\"2%\">"; echo "[<a href=\"checksum/$filename.md5\">md5</a>]"; echo "</td>"; } @@ -94,12 +94,21 @@ function isMirrored($uriToCheck) { if ($debugScript) { echo "uriToCheck: " . $localuri . "<br />"; } + + $xmlcount = 0; + + /* This method true and accurate method of parsing mirror results + * may be expensive, and would + * likely cause artificially high counts of "downloads". + * Could maybe use if somehow only checked once ever 5 minutes or something. + + // turn off warnings, as sometimes HTML is returned, which causes lots of warnings $holdLevel = error_reporting(E_ERROR); $mirrorsxml=simplexml_load_file(rawurlencode($localuri) . urlencode("&format=xml")); error_reporting($holdLevel); - $xmlcount = 0; + if ($mirrorsxml) { if ($debugFunctions) { echo "root node: " . $mirrorsxml->getName() . "<br />"; @@ -119,6 +128,14 @@ function isMirrored($uriToCheck) { echo "Mirror count: " . $xmlcount . "<br />"; } } + */ + /* + * Use simple heuristic based on pattern + * in the URI ... if it contains "/downloads/" then assume it's mirrored + */ + if (strpos($uriToCheck, "webtools/downloads/") > 0) { + $xmlcount = 1; + } return ($xmlcount > 0); } @@ -127,6 +144,7 @@ function getPlatform () { global $debugScript; global $debugFunctions; $browser = get_browser(null, true); + if ($browser) { $rawPlatform = $browser['platform']; if ($debugFunctions) { echo "browser platfrom: " . $rawPlatform . "<br />" ; @@ -138,6 +156,7 @@ function getPlatform () { echo $key . ": " . $browser[$key] . "<br />"; } } + } $platform = "unknown"; if (strpos($rawPlatform, "Win") === 0) { $platform="windows"; @@ -149,13 +168,15 @@ function getPlatform () { return $platform; } -function getPrereqReferenceOrName($prerequrl, $prereqname) { +function getPrereqReferenceOrName($eclipseMirrorScript, $mirrorPrefixuri, $prerequrl, $prereqfilename) { // todo: we really only need "if exists" so could make a bit more efficient // I tried "file_exists" but is didn't seem to work on my test server + // For these pre-reqs, we assume if they exist, they are mirrored. This is true + // 99% of the time. if (stream_last_modified($prerequrl)) { - $reflink="<a href=\"" . $prerequrl . "\">" . $prereqname . "</a>"; + $reflink="<a href=\"" . $eclipseMirrorScript . $mirrorPrefixuri . "/" . $prereqfilename . "\">" . $prereqfilename . "</a>"; } else { - $reflink=$prereqname; + $reflink=$prereqfilename; } return $reflink; } diff --git a/releng.wtpbuilder/distribution/patches.site/publish.xml b/releng.wtpbuilder/distribution/patches.site/publish.xml index d3922fe17..be0ff0506 100644 --- a/releng.wtpbuilder/distribution/patches.site/publish.xml +++ b/releng.wtpbuilder/distribution/patches.site/publish.xml @@ -154,7 +154,7 @@ --> <property - file="${buildDirectory}/maps/releng/maps/dependencies.properties" /> + file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" /> <!-- create table of test plugin compiles first --> <!-- set isBuildTested to true for the "compile only" results --> diff --git a/releng.wtpbuilder/distribution/wtp.site/publish.xml b/releng.wtpbuilder/distribution/wtp.site/publish.xml index 3461ca8a6..9bc3f4b3b 100644 --- a/releng.wtpbuilder/distribution/wtp.site/publish.xml +++ b/releng.wtpbuilder/distribution/wtp.site/publish.xml @@ -181,13 +181,6 @@ <antcall target="writeData" /> - <mkdir dir="${resultDir}/whatisfixed" /> - <echo - file="${resultDir}/whatisfixed/buglog.html" - append="true"> - what is fixed list is not available yet! - </echo> - <!-- Update timestamp on file to permit overwrite through Ant copy task --> <touch file="${resultingIndex}" /> </target> @@ -207,6 +200,9 @@ <fileset dir="${buildDirectory}/plugins" includes="**/buildnotes_*.html" /> + <fileset + dir="${buildDirectory}/features" + includes="**/buildnotes_*.html" /> </copy> @@ -342,6 +338,16 @@ value="Test" /> </target> + <target name="P"> + <replace + file="${resultingIndex}" + token="%wtpandprereqs%" + value=" " /> + <replace + file="${resultingIndex}" + token="@type@" + value="Patches" /> + </target> <target name="checkIfTested"> <echo diff --git a/releng.wtpbuilder/distribution/wtp.site/staticDropFiles/miscUtil.php b/releng.wtpbuilder/distribution/wtp.site/staticDropFiles/miscUtil.php index 11f4948df..2ef71e8f1 100644 --- a/releng.wtpbuilder/distribution/wtp.site/staticDropFiles/miscUtil.php +++ b/releng.wtpbuilder/distribution/wtp.site/staticDropFiles/miscUtil.php @@ -168,7 +168,6 @@ function getPlatform () { return $platform; } - function getPrereqReferenceOrName($eclipseMirrorScript, $mirrorPrefixuri, $prerequrl, $prereqfilename) { // todo: we really only need "if exists" so could make a bit more efficient // I tried "file_exists" but is didn't seem to work on my test server -- GitLab