cvs: php-testfest-web /scripts/testfestsource README /scripts/testfestsource/src PhpTestFestRegistration.css dailybuild displayresults.php
extractteststest.php filelist.php get.php hourlypublish hourlyrun killcurl.php make_test_directories.sh publishresults.sh testfest_icon.png
testfesthourlytest.php testmanager.css tick.gif tmClassMap.php viewfilecontents.php /scripts/testfestsource/src/testsetup tmCvsCheck.php
tmExtractTests.php /scripts/testfestsource/src/testsetup/unix tmUnixGetPhp.php
| From: | Zoe Slattery | Date: | Mon, 18 May 2009 16:10:59 +0000 |
| Subject: | cvs: php-testfest-web /scripts/testfestsource README /scripts/testfestsource/src PhpTestFestRegistration.css dailybuild displayresults.php extractteststest.php filelist.php get.php hourlypublish hourlyrun killcurl.php make_test_directories.sh publishresults.sh testfest_icon.png testfesthourlytest.php testmanager.css tick.gif tmClassMap.php viewfilecontents.php /scripts/testfestsource/src/testsetup tmCvsCheck.php tmExtractTests.php /scripts/testfestsource/src/testsetup/unix tmUnixGetPhp.php |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-4796@lists.php.net to get a copy of this message | ||
zoe Mon May 18 16:10:59 2009 UTC
Added files:
/php-testfest-web/scripts/testfestsource/src tick.gif dailybuild
get.php
testfest_icon.png
PhpTestFestRegistration.css
hourlyrun
make_test_directories.sh
killcurl.php
hourlypublish
extractteststest.php
filelist.php
/php-testfest-web/scripts/testfestsource/src/testsetup
tmCvsCheck.php
Removed files:
/php-testfest-web/scripts/testfestsource/src testmanager.css
Modified files:
/php-testfest-web/scripts/testfestsource/src publishresults.sh
displayresults.php
testfesthourlytest.php
viewfilecontents.php
tmClassMap.php
/php-testfest-web/scripts/testfestsource/src/testsetup
tmExtractTests.php
/php-testfest-web/scripts/testfestsource README
/php-testfest-web/scripts/testfestsource/src/testsetup/unix
tmUnixGetPhp.php
Log:
Multiple updates after deployment on sp1
http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/publishresults.sh?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/publishresults.sh diff -u php-testfest-web/scripts/testfestsource/src/publishresults.sh:1.1 php-testfest-web/scripts/testfestsource/src/publishresults.sh:1.2 --- php-testfest-web/scripts/testfestsource/src/publishresults.sh:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/publishresults.sh Mon May 18 16:10:59 2009 @@ -3,9 +3,9 @@ tar -cvzf tf.tar * -cp tf.tar /var/www/html/publishresults/ +cp tf.tar /var/www/results.testfest.php.net/public_html/publishresults/ -cd /var/www/html/publishresults/ +cd /var/www/results.testfest.php.net/public_html/publishresults/ tar -xvf tf.tar http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/displayresults.php?r1=1.2&r2=1.3&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/displayresults.php diff -u php-testfest-web/scripts/testfestsource/src/displayresults.php:1.2 php-testfest-web/scripts/testfestsource/src/displayresults.php:1.3 --- php-testfest-web/scripts/testfestsource/src/displayresults.php:1.2 Sat May 9 15:29:42 2009 +++ php-testfest-web/scripts/testfestsource/src/displayresults.php Mon May 18 16:10:59 2009 @@ -9,12 +9,14 @@ <title>PHPT results</title> </head> -<h1> PHP TestFest 2009 run results</h1> +<h1> PHP TestFest 2009 run results - 32 bit Linux</h1> -<body> -<p>This site is for checking tests that are contributed as part of PHP TestFest 2009. The tests are committed in a subversion repository, then extracted and run usung PHP5.2, PHP5.3 and PHP6.0. TestFest is focussed on PHP5.3, so the test should really work with PHP5.3. The PHP5.2 and PHP6.0 results are there to help people who will commit the tests in PHP's CVS to know how much work they have to do. +<a href=http://testfest.php.net/displayresults.php>Results on 64 bit PPC Linux are here</a> -<p>The tests are being run on a 64bit Linux machine (which is currently having problems building PHP6), the results table should be updated hourly, at 20 minutes past the hour. +<body> +<p>This site is for checking tests that are contributed as part of PHP TestFest 2009. <p>The tests are committed in a subversion repository, then extracted and run using PHP5.2, PHP5.3 and PHP6. TestFest is focussed on PHP5.3, so the tests should work with PHP5.3. The PHP5.2 and PHP 6 results are there to help people who will commit the tests in PHP's CVS to know how much work they have to do. +<p>The final column in the table shows whether the test has already been reviewed and committed in PHP's CVS repository. +<p>The results table is updated hourly, at approximately 40 minutes past the hour. <p>The name of the user group responsible for writing the test is appended at that end of the test name. Thanks! <?php @@ -24,63 +26,108 @@ 'php5.2', ); $publishDir = 'publishresults'; -$testRunDir = '/home/testfestreports/testRunDir'; +$testRunDir = '/p2/home/testfestreports/testRunDir'; +$relat = array(); foreach($phpVersion as $version) { $testfile=$publishDir."/".$version."/results"; -// echo "<br>$testfile<br>"; $results = file($testfile); foreach($results as $line) { - if(preg_match('/^TEST.*\s+([A-Z]{4})\s+.*\[(.*)\]/', $line, $matches)) { + if(preg_match('/^TEST.*\s+(WARN|SKIP|PASS|FAIL|XFAIL|BORK|WARN&FAIL)\s+.*\[(.*\.phpt)\]/', $line, $matches)) { + + $state = $matches[1]; + + //subtract the final .phpt off the test names $base = substr($matches[2], 0, -5); + + //strip off the location dependent part of the path $relativename = substr($base, strlen($testRunDir."/".$version."/")); + + //construct the full name of the published location of the test file and its output files $publishname = $publishDir."/".$version."/".$relativename; - $tests[] = $publishname; + $relat[] = $relativename; $states[$relativename][$version] = $matches[1]; $filebase[$relativename][$version] = $publishname; } } - $relat = array_unique($relat); + if(isset($relat)) { + $relat = array_unique($relat); + } +} + +//get the list of committed files +$testNames = file($publishDir . "/commits"); +$committedTests = array(); + +foreach ($testNames as $line) { + $strip = substr(trim($line), 1); //get rid of the starting / and the LF + $committedTests[] = substr($strip, 0, -strlen(".phpt")); //get rid of the .phpt } $_SESSION['states'] = $states; $_SESSION['filebase'] = $filebase; $_SESSION['relat'] = $relat; -$out = buildSummaryTable($states, $relat, $filebase); +$summary = buildSummary($relat); +echo $summary; + +$out = buildSummaryTable($states, $relat, $filebase, $committedTests); echo $out; -function buildSummaryTable($states, $relat, $filebase) { +function buildSummary($relat) { +$groups = array(); +foreach($relat as $testname) { + preg_match("/.*_(\w+)$/", $testname, $matches); + $groupName = $matches[1]; + if(isset($groups[$groupName])) { + $groups[$groupName] ++; + } else { + $groups[$groupName] = 1; + } + } +$htmlString = "<h2> Break down of tests by PHP User Group </h2>"; +$totalTests = 0; +foreach ($groups as $groupName => $numberOfTests) { + $totalTests += $numberOfTests; + $htmlString .= "Tests from group $groupName = $numberOfTests<br>"; +} +$htmlString .= "<br><b>Total tests contributed = $totalTests</b><br><br>"; + +return $htmlString; +} + + + +function buildSummaryTable($states, $relat, $filebase, $committedTests) { $htmlString = "<table class=\"resultTable\">"; - $htmlString .= "<th>TestName</th><th>PHP52</th><th>PHP53</th><th>PHP6</th>"; + $htmlString .= "<th>TestName</th><th>PHP52</th><th>PHP53</th><th>PHP6</th><th>CVS?</th>"; foreach($relat as $testname) { $s52 = $states[$testname]['php5.2']; - if($s52 == 'FAIL') { $basename = $filebase[$testname]['php5.2']; - $ref = 'failedfilelist.php?basename='.$basename; - $s52 = "<a href=$ref>X</a><br>"; - } + $ref = 'filelist.php?basename='.$basename; + $s52 = "<a href=$ref>$s52</a><br>"; $s53 = $states[$testname]['php5.3']; - if($s53 == 'FAIL') { $basename = $filebase[$testname]['php5.3']; - $ref = 'failedfilelist.php?basename='.$basename; - $s53 = "<a href=$ref>X</a><br>"; - } + $ref = 'filelist.php?basename='.$basename; + $s53 = "<a href=$ref>$s53</a><br>"; $s60 = $states[$testname]['php6.0']; - if($s60 == 'FAIL') { $basename = $filebase[$testname]['php6.0']; - $ref = 'failedfilelist.php?basename='.$basename; - $s60 = "<a href=$ref>X</a><br>"; - } + $ref = 'filelist.php?basename='.$basename; + $s60 = "<a href=$ref>$s60</a><br>"; + if(in_array($testname, $committedTests)) { + $committed = "<img src=\"tick.gif\">"; + } else { + $committed = "N"; + } - $htmlString .= "<tr><td>$testname</td><td>$s52</td><td>$s53</td><td>$s60</td></tr>"; + $htmlString .= "<tr><td>$testname</td><td>$s52</td><td>$s53</td><td>$s60</td><td>$committed</td></tr>"; } $htmlString .= "</table>"; return $htmlString; http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php?r1=1.2&r2=1.3&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php diff -u php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php:1.2 php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php:1.3 --- php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php:1.2 Sat May 9 15:29:42 2009 +++ php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php Mon May 18 16:10:59 2009 @@ -14,6 +14,7 @@ $rootDir = "/home/testfestreports"; $svnCheckOutDir = $rootDir."/svnCheckOutDir"; +$cvsCheckOutDir = $rootDir."/cvsCheckOutDir/php5"; $phpBuildDir = $rootDir."/phpBuildDir"; @@ -31,10 +32,13 @@ if(!is_dir($svnCheckOutDir)) { $testSetup->checkOut(); } else { - echo "updating\n"; + echo "updating SVN\n"; $testSetup->update(); } +//set enviroment variable needed for CURL tests. Better not to do this, shoudl have an --ENV-- section & --SKIPIF-- +putenv('PHP_CURL_HTTP_REMOTE_SERVER=http://results.testfest.php.net'); + $testSetup->setFilesToCopy(); $filesToCopy = $testSetup->getFilesToCopy(); @@ -48,7 +52,7 @@ $from = trim($svnCheckOutDir."/testfest/".$file); $destFile = $testSetup->targetFileName($file); $to = $testRunDir."/".$dir."/".$destFile; - echo "Copy $from to $to\n"; + // echo "Copy $from to $to\n"; shell_exec("cp $from $to"); } } @@ -61,10 +65,11 @@ $results = shell_exec("$phpExecutable -n $run_tests -n -p $phpExecutable $testDir"); file_put_contents($testDir."/results", $results); } +//check to see what has already been committed - just does a 5.3 check an gets a list of files that +// have been copied to CVS - - - - - +$cvsChecker = new tmCvsCheck($testRunDir . "/php5.3", $cvsCheckOutDir); +$commitList = $cvsChecker->makeCommitList(); +$commitString = implode("\n", $commitList); +file_put_contents($testRunDir . "/commits", $commitString); ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/viewfilecontents.php?r1=1.2&r2=1.3&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/viewfilecontents.php diff -u php-testfest-web/scripts/testfestsource/src/viewfilecontents.php:1.2 php-testfest-web/scripts/testfestsource/src/viewfilecontents.php:1.3 --- php-testfest-web/scripts/testfestsource/src/viewfilecontents.php:1.2 Sat May 9 15:29:42 2009 +++ php-testfest-web/scripts/testfestsource/src/viewfilecontents.php Mon May 18 16:10:59 2009 @@ -31,9 +31,8 @@ echo "<br><b>File:".$file."</b><br><br>"; $file = realpath($file); - -if (strpos($file, '/var/www/html/publishresults/') !== 0) { - echo "Test file outside expected path<br />"; +if (strpos($file, '/p2/var/www/results.testfest.php.net/public_html/publishresults/') !== 0) { + echo "Test file $file outside expected path<br />"; } else { $contents = file($file); @@ -42,7 +41,7 @@ } } -echo "<br /><br /><a href='failedfilelist.php?basename=$basename'>Back to file list</a><br />"; +echo "<br /><br /><a href='filelist.php?basename=$basename'>Back to file list</a><br />"; ?> </body> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/tmClassMap.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/tmClassMap.php diff -u php-testfest-web/scripts/testfestsource/src/tmClassMap.php:1.1 php-testfest-web/scripts/testfestsource/src/tmClassMap.php:1.2 --- php-testfest-web/scripts/testfestsource/src/tmClassMap.php:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/tmClassMap.php Mon May 18 16:10:59 2009 @@ -1,5 +1,6 @@ <?php $tmClassMap = array( + 'tmCvsCheck' => 'testsetup/tmCvsCheck.php', 'tmExtractTests' => 'testsetup/tmExtractTests.php', 'tmGetPhp' => 'testsetup/tmGetPhp.php', 'tmUnixGetPhp' => 'testsetup/unix/tmUnixGetPhp.php', http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php diff -u php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php:1.1 php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php:1.2 --- php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php Mon May 18 16:10:59 2009 @@ -23,7 +23,7 @@ public function update() { $current = realpath(getcwd()); - chdir($this->svnTestLocation."/".testfest); + chdir($this->svnTestLocation."/testfest"); shell_exec("svn update"); chdir($current); } @@ -42,6 +42,7 @@ $incFiles = explode('./', $fileList); $relNamesToCopy = array_merge($phptFiles, $incFiles); + //remove any bogus entries foreach ($relNamesToCopy as $filename) { $filename = trim($filename); @@ -58,6 +59,8 @@ public function targetFileName($name) { if(preg_match('/(\w+)\/(.*).phpt/', $name, $matches)) { $target = $matches[2]."_".$matches[1].".phpt"; + } else if(preg_match('/(\w+)\/(.*).inc/', $name, $matches)) { + $target = $matches[2].".inc"; } else { $target = $name; } http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/README?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/README diff -u php-testfest-web/scripts/testfestsource/README:1.1 php-testfest-web/scripts/testfestsource/README:1.2 --- php-testfest-web/scripts/testfestsource/README:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/README Mon May 18 16:10:59 2009 @@ -1,36 +1,57 @@ -These are the scripts that extract tests from SVN, run them and display the results. They expect -a specific directory structure. -testfestroot - /phpBuildDir (create in advance) - /svnCheckOutDir (this will be created the first time you run testfesthourly.php) - /testRunDir (create this AND subdirectories in advance, use make_test_directories.sh). - /php5.2 - /php5.3 - /php6.0 +Server names currently in use +============================= -Then modify teh code to set the $rootDir - -The web site is: http://testfest.php.net/displayresults.php +http://results.testfest.php.net/displayresults.php 1) There is a PHP script to extract and build PHP once a day. /home/zoe/testfestsource/src/testfestdaily.php -Currently fails to build a working PHP 6 but is OK for the others. This is not in cron yet. 2) Script to update SVN, copy the phpt files out to run directoris, run them against 52, 53 and 6. /home/zoe/testfestsource/src/testfesthourly.php -Runs once an hour. See /etc/cron.hourly to set it up. (/sbin/service crond status|stop|start). +Runs once an hour, 20 mins past. 3) shell script to publish the results /home/zoe/testfestsource/src/publishresults.sh -Runs once an hour AFTER above. +Published once an hour at 40 minutes past. + +4) Three files in /var/www/html +displayresults.php, viewcontents.php, filelist.php + +5) The results are published in /var/www/server-doc-root/publishresults -4) Three files need to be copied to in /var/www/html -displayresults.php, viewcontents.php, failedfilelist.php +Steps in deploying the scripts on a new *ix server, assume xxx is your UID -5) The results are published in /var/www/html/publishresults which also needs to be created in advance +0. Create a tar file of everything under the testfest directory. +1. Copy the tar of all the source into /home/xxx on teh server you want to deploy on +2. Create /home/testfestreports/phpBuildDir (allow writes to it) + sudo chown -R xxx testfestreports +3. Run /home/zoe/testfestsource/src/testfestdaily.php to download and build PHP + Check the config options in src/testsetup/unix/tmUnixGetPhp.php, you may need to install stuff +4. Create /home/testfestreports/cvsCheckoutDir +5. In cvsCheckoutDir, + cvs -d :pserver:cvsread@cvs.php.net:/repository login + password: phpfi + cvs -d :pserver:cvsread@cvs.php.net:/repository checkout -r PHP_5_3 php5 +6. Create /home/testfestreports/testRunDir + create sub directories php5.2, php5.3, php6.0 + create a source tree in each using make_test_directories.sh +7. Run phptestfesthourly.php. This will create the final directory (/home/testfestreports/svnCheckoutDir) and fetch a copy of the test cases. +8. Create new Vhost (see /etc/apache), the one on sp1 is called results.testfest.php.net +9. Make its doc root somewhere under /var/www (ex /var/www/results.testfest.php.net/public_html) +10. Modify publishresults.sh to point to the right dir under doc root +11. cd /var/www/results.testfest.php.net/public_html/; sudo mkdir publishresults +12. copy displayresults.php /var/www/results.testfest.php.net/public_html, and viewfilecontents and filelist. +13 copy the PhpTestFestRegistration.css and tick.gif across too +14. Check/fix some paths in displayresults.php and viewfilecontents +15. Setup three cron jobs. As user xxx: + run hourlyrun once every hour + run dailybuild once every day + As root: + run hourlypublish (20 minutes after hourly run) +16. Copy get.php into public.html directory (this is so that the curl tests run. Modify the CURL responder in hourly php script too) http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php diff -u php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php:1.1 php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php:1.2 --- php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php Mon May 18 16:10:59 2009 @@ -47,8 +47,11 @@ public function buildPHP ($buildsDir) { $configure_flags = ""; + //Note that php6.0 does not build with intl on this machine. if(substr($this->buildType, -strlen('6.0')) == '6.0') { - $configure_flags .= "--with-icu-dir=/home/testfestreports/phpBuildDir/ICU-install"; + $configure_flags .= "--with-icu-dir=/usr/local --with-gettext --with-ldap --with-xsl --enable-sockets --with-tidy --with-zlib=/usr --enable-json --with-imap=/usr --with-kerberos --with-imap-ssl=/usr --enable-pcntl --enable-ftp --with-curl=/usr"; + } else { + $configure_flags .= "--enable-intl --with-gettext --with-ldap --with-xsl --enable-sockets --with-tidy --with-zlib=/usr --enable-json --with-imap=/usr --with-kerberos --with-imap-ssl=/usr --enable-pcntl --enable-ftp --with-curl=/usr"; } $current = realpath(getcwd()); chdir($buildsDir."/".$this->buildType); http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/get.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/get.php +++ php-testfest-web/scripts/testfestsource/src/get.php <?php switch($_GET['test']) { case 'post': var_dump($_POST); break; case 'getpost': var_dump($_GET); var_dump($_POST); break; case 'referer': echo $_SERVER['HTTP_REFERER']; break; case 'useragent': echo $_SERVER['HTTP_USER_AGENT']; break; default: echo "Hello World!\n"; echo "Hello World!"; break; } ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/PhpTestFestRegistration.css?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/PhpTestFestRegistration.css +++ php-testfest-web/scripts/testfestsource/src/PhpTestFestRegistration.css body { padding-left: 11em; font-family: Georgia, "Times New Roman", Times, serif; color: #b9484a; background-color: #89df00 } ul.navbar { list-style-type: none; padding: 0; margin: 0; position: absolute; top: 2em; left: 1em; width: 9em } h1 { font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif } ul.navbar li { background: white; margin: 0.5em 0; padding: 0.3em; border-right: 1em solid black } ul.navbar a { text-decoration: none } a:link { color: blue } a:visited { color: purple } address { margin-top: 1em; padding-top: 1em; border-top: thin dotted } table.resultTable { width: 70%; padding: 0px; border: none; border: 1px solid #b944a4;} table.resultTable th { font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #1D1AB2; border-right: 2px solid #2b8a3b; border-bottom: 2px solid #2b8a3b; border-top: 2px solid #2b8a3b; letter-spacing: 2px; text-transform: uppercase; text-align: left; padding: 6px 6px 6px 6px; } table.resultTable td { border-right: 2px solid #2b8a3b; border-bottom: 2px solid #2b8a3b; background: #fff; padding: 6px 6px 6px 6px; color: #323086; } table.resultTable tr.special td { background: #2b8a3b; } http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/make_test_directories.sh?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/make_test_directories.sh +++ php-testfest-web/scripts/testfestsource/src/make_test_directories.sh mkdir -p ext/date/tests mkdir -p ext/simplexml/tests mkdir -p ext/pdo_pgsql/tests mkdir -p ext/json/tests mkdir -p ext/tokenizer/tests mkdir -p ext/shmop/tests mkdir -p ext/wddx/tests mkdir -p ext/sybase_ct/tests mkdir -p ext/dba/tests mkdir -p ext/pspell/tests mkdir -p ext/pdo_odbc/tests mkdir -p ext/mysqli/tests mkdir -p ext/sqlite3/tests mkdir -p ext/tidy/tests mkdir -p ext/sysvsem/tests mkdir -p ext/sqlite/tests mkdir -p ext/sqlite/tests/pdo mkdir -p ext/curl/tests mkdir -p ext/sysvmsg/tests mkdir -p ext/pdo_firebird/tests mkdir -p ext/bcmath/tests mkdir -p ext/phar/tests mkdir -p ext/phar/tests/cache_list mkdir -p ext/phar/tests/zip mkdir -p ext/phar/tests/tar mkdir -p ext/fileinfo/tests mkdir -p ext/mysql/tests mkdir -p ext/exif/tests mkdir -p ext/spl/examples/tests mkdir -p ext/spl/tests mkdir -p ext/pcre/tests mkdir -p ext/soap/tests mkdir -p ext/soap/tests/soap12 mkdir -p ext/soap/tests/interop/Round3/GroupD mkdir -p ext/soap/tests/interop/Round3/GroupE mkdir -p ext/soap/tests/interop/Round3/GroupF mkdir -p ext/soap/tests/interop/Round4/GroupI mkdir -p ext/soap/tests/interop/Round4/GroupH mkdir -p ext/soap/tests/interop/Round2/GroupB mkdir -p ext/soap/tests/interop/Round2/Base mkdir -p ext/soap/tests/schema mkdir -p ext/soap/tests/bugs mkdir -p ext/calendar/tests mkdir -p ext/ftp/tests mkdir -p ext/pdo_mysql/tests mkdir -p ext/ctype/tests mkdir -p ext/mbstring/tests mkdir -p ext/libxml/tests mkdir -p ext/ldap/tests mkdir -p ext/reflection/tests mkdir -p ext/enchant/tests mkdir -p ext/xmlreader/tests mkdir -p ext/standard/tests/filters mkdir -p ext/standard/tests/versioning mkdir -p ext/standard/tests/serialize mkdir -p ext/standard/tests/general_functions mkdir -p ext/standard/tests/assert mkdir -p ext/standard/tests/url mkdir -p ext/standard/tests/streams mkdir -p ext/standard/tests/array mkdir -p ext/standard/tests/mail mkdir -p ext/standard/tests/class_object mkdir -p ext/standard/tests/file mkdir -p ext/standard/tests/directory mkdir -p ext/standard/tests/time mkdir -p ext/standard/tests/math mkdir -p ext/standard/tests/image mkdir -p ext/standard/tests/dir mkdir -p ext/standard/tests/misc mkdir -p ext/standard/tests/strings mkdir -p ext/standard/tests/network mkdir -p ext/pcntl/tests mkdir -p ext/imap/tests mkdir -p ext/gmp/tests mkdir -p ext/sockets/tests mkdir -p ext/session/tests mkdir -p ext/hash/tests mkdir -p ext/posix/tests mkdir -p ext/bz2/tests mkdir -p ext/zip/tests mkdir -p ext/mcrypt/tests mkdir -p ext/pdo_sqlite/tests mkdir -p ext/sysvshm/tests mkdir -p ext/com_dotnet/tests mkdir -p ext/iconv/tests mkdir -p ext/xml/tests mkdir -p ext/zlib/tests mkdir -p ext/xmlrpc/tests mkdir -p ext/dom/tests mkdir -p ext/xsl/tests mkdir -p ext/readline/tests mkdir -p ext/pgsql/tests mkdir -p ext/gd/tests mkdir -p ext/intl/tests mkdir -p ext/pdo/tests mkdir -p ext/pdo_oci/tests mkdir -p ext/gettext/tests mkdir -p ext/openssl/tests mkdir -p ext/ereg/tests mkdir -p ext/oci8/tests mkdir -p ext/filter/tests mkdir -p ext/interbase/tests mkdir -p ext/skeleton/tests mkdir -p ext/xmlwriter/tests mkdir -p Zend/tests mkdir -p Zend/tests/multibyte mkdir -p Zend/tests/constants mkdir -p tests/lang mkdir -p tests/output mkdir -p tests/security mkdir -p tests/func mkdir -p tests/basic mkdir -p tests/run-test mkdir -p tests/strings mkdir -p tests/classes mkdir -p sapi/cli/tests mkdir -p sapi/tests mkdir -p sapi/cgi/tests http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/killcurl.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/killcurl.php +++ php-testfest-web/scripts/testfestsource/src/killcurl.php <?php $processes = shell_exec("ps -ef | grep Paris"); $process_list = explode("risUG.php", $processes); foreach ($process_list as $line) { if (preg_match("#zoe\s+(\d+)\s+.*Pa$#", $line, $matches)) { shell_exec("kill " . $matches[1]); } } ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/extractteststest.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/extractteststest.php +++ php-testfest-web/scripts/testfestsource/src/extractteststest.php <?php require_once dirname(__FILE__) . '/tmAutoload.php'; $repositoryPath = "http://89.151.87.83/repos/testfest"; //Setup $rootDir = "/home/testfestreports"; $svnCheckOutDir = $rootDir."/svnCheckOutDir"; $cvsCheckOutDir = $rootDir."/cvsCheckOutDir/php5"; $phpBuildDir = $rootDir."/phpBuildDir"; $testRunDir = $rootDir."/testRunDir"; $phpVersion = array( 'php6.0', 'php5.3', 'php5.2', ); //Script sould run once an hour. Relies on having PHP builds in the right place $testSetup = new tmExtractTests($repositoryPath, $svnCheckOutDir); $testSetup->setFilesToCopy(); $filesToCopy = $testSetup->getFilesToCopy(); var_dump($filesToCopy); //copy all the files into a directory thay can be run from foreach($phpVersion as $dir) { //remove .phpt files from last run, necessary of people have moved things around in SVN. shell_exec("find $testRunDir/$dir -name \"*.phpt\" | xargs -i rm {}"); foreach ($filesToCopy as $file) { $from = trim($svnCheckOutDir."/testfest/".$file); $destFile = $testSetup->targetFileName($file); $to = $testRunDir."/".$dir."/".$destFile; echo "Copy $from to $to\n"; // shell_exec("cp $from $to"); } } ?> ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/filelist.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/filelist.php +++ php-testfest-web/scripts/testfestsource/src/filelist.php <?php session_start()?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <link rel="stylesheet" href="PhpTestFestRegistration.css"> <head> <title>Output files</title> </head> <body> <?php $rootDir = "/home/testfestreports"; $svnCheckOutDir = $rootDir."/svnCheckOutDir"; $phpBuildDir = $rootDir."/phpBuildDir"; $testRunDir = $rootDir."/testRunDir"; $phpVersion = array( 'php6.0', 'php5.3', //'php5.2', ); $base = $_GET['basename']; //$base = preg_replace('#[^a-z_-.]#', '', $base); $base = preg_replace('#[^a-z0-9_\-\.\/]#i', '', $base); $_SESSION['basename'] = $base; $expFile = $base.".exp"; $outFile = $base.".out"; $difFile = $base.".diff"; $phptFile = $base.".phpt"; $phpFile = $base.".php"; echo "<br><br><b>Output files for test: $base.phpt</b><br><br>"; echo "<b>View test case source: </b> <br>"; echo "<a href=viewfilecontents.php?file=".$phptFile.">Test file</a><br>"; echo "<br><b>Check these if the test has failed: </b> <br>"; echo "<a href=viewfilecontents.php?file=".$outFile.">Actual output</a><br>"; echo "<a href=viewfilecontents.php?file=".$expFile.">Expected output</a><br>"; echo "<a href=viewfilecontents.php?file=".$difFile.">Difference</a><br>"; echo "<a href=viewfilecontents.php?file=".$phpFile.">PHP</a><br>"; echo "<br><br><a href=displayresults.php>Back to results table</a><br>"; ?> </body> </html> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testsetup/tmCvsCheck.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/testsetup/tmCvsCheck.php +++ php-testfest-web/scripts/testfestsource/src/testsetup/tmCvsCheck.php <?php class tmCvsCheck { protected $cvsDir; protected $runDir; protected $fileList = array(); protected $normalisedFileNames = array(); protected $relativeFileNames = array(); public function __construct($runDir, $cvsDir) { $this->runDir = $runDir; $this->cvsDir = $cvsDir; $this->getFiles(); $this->cvsUp(); $this->normaliseFileNames(); } public function cvsUp() { $current = realpath(getcwd()); chdir($this->cvsDir); shell_exec("cvs up"); chdir($current); } public function getFiles() { $fileString = shell_exec("find $this->runDir -name \"*.phpt\" -print"); foreach(explode("\n", $fileString) as $file) { if (substr($file, -strlen(".phpt")) == ".phpt") { $this->fileList[] = $file; } } } public function normaliseFileNames() { foreach ($this->fileList as $fileName) { if(preg_match("#$this->runDir(.*)(_\w+\.phpt)$#", $fileName, $matches)) { $this->normalisedFileNames[] = $matches[1] . ".phpt"; $this->relativeFileNames[] = $matches[1] . $matches[2]; } } } public function isCommitted($name) { if(file_exists($this->cvsDir . "/" . $name)) { return true; } return false; } public function makeCommitList() { $committed = array(); for($i = 0; $i < count($this->fileList); $i++) { $file = $this->normalisedFileNames[$i]; if($this->isCommitted($file)) { $committed[] = $this->relativeFileNames[$i]; } } return $committed; } } ?>
http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/publishresults.sh?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/publishresults.sh diff -u php-testfest-web/scripts/testfestsource/src/publishresults.sh:1.1 php-testfest-web/scripts/testfestsource/src/publishresults.sh:1.2 --- php-testfest-web/scripts/testfestsource/src/publishresults.sh:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/publishresults.sh Mon May 18 16:10:59 2009 @@ -3,9 +3,9 @@ tar -cvzf tf.tar * -cp tf.tar /var/www/html/publishresults/ +cp tf.tar /var/www/results.testfest.php.net/public_html/publishresults/ -cd /var/www/html/publishresults/ +cd /var/www/results.testfest.php.net/public_html/publishresults/ tar -xvf tf.tar http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/displayresults.php?r1=1.2&r2=1.3&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/displayresults.php diff -u php-testfest-web/scripts/testfestsource/src/displayresults.php:1.2 php-testfest-web/scripts/testfestsource/src/displayresults.php:1.3 --- php-testfest-web/scripts/testfestsource/src/displayresults.php:1.2 Sat May 9 15:29:42 2009 +++ php-testfest-web/scripts/testfestsource/src/displayresults.php Mon May 18 16:10:59 2009 @@ -9,12 +9,14 @@ <title>PHPT results</title> </head> -<h1> PHP TestFest 2009 run results</h1> +<h1> PHP TestFest 2009 run results - 32 bit Linux</h1> -<body> -<p>This site is for checking tests that are contributed as part of PHP TestFest 2009. The tests are committed in a subversion repository, then extracted and run usung PHP5.2, PHP5.3 and PHP6.0. TestFest is focussed on PHP5.3, so the test should really work with PHP5.3. The PHP5.2 and PHP6.0 results are there to help people who will commit the tests in PHP's CVS to know how much work they have to do. +<a href=http://testfest.php.net/displayresults.php>Results on 64 bit PPC Linux are here</a> -<p>The tests are being run on a 64bit Linux machine (which is currently having problems building PHP6), the results table should be updated hourly, at 20 minutes past the hour. +<body> +<p>This site is for checking tests that are contributed as part of PHP TestFest 2009. <p>The tests are committed in a subversion repository, then extracted and run using PHP5.2, PHP5.3 and PHP6. TestFest is focussed on PHP5.3, so the tests should work with PHP5.3. The PHP5.2 and PHP 6 results are there to help people who will commit the tests in PHP's CVS to know how much work they have to do. +<p>The final column in the table shows whether the test has already been reviewed and committed in PHP's CVS repository. +<p>The results table is updated hourly, at approximately 40 minutes past the hour. <p>The name of the user group responsible for writing the test is appended at that end of the test name. Thanks! <?php @@ -24,63 +26,108 @@ 'php5.2', ); $publishDir = 'publishresults'; -$testRunDir = '/home/testfestreports/testRunDir'; +$testRunDir = '/p2/home/testfestreports/testRunDir'; +$relat = array(); foreach($phpVersion as $version) { $testfile=$publishDir."/".$version."/results"; -// echo "<br>$testfile<br>"; $results = file($testfile); foreach($results as $line) { - if(preg_match('/^TEST.*\s+([A-Z]{4})\s+.*\[(.*)\]/', $line, $matches)) { + if(preg_match('/^TEST.*\s+(WARN|SKIP|PASS|FAIL|XFAIL|BORK|WARN&FAIL)\s+.*\[(.*\.phpt)\]/', $line, $matches)) { + + $state = $matches[1]; + + //subtract the final .phpt off the test names $base = substr($matches[2], 0, -5); + + //strip off the location dependent part of the path $relativename = substr($base, strlen($testRunDir."/".$version."/")); + + //construct the full name of the published location of the test file and its output files $publishname = $publishDir."/".$version."/".$relativename; - $tests[] = $publishname; + $relat[] = $relativename; $states[$relativename][$version] = $matches[1]; $filebase[$relativename][$version] = $publishname; } } - $relat = array_unique($relat); + if(isset($relat)) { + $relat = array_unique($relat); + } +} + +//get the list of committed files +$testNames = file($publishDir . "/commits"); +$committedTests = array(); + +foreach ($testNames as $line) { + $strip = substr(trim($line), 1); //get rid of the starting / and the LF + $committedTests[] = substr($strip, 0, -strlen(".phpt")); //get rid of the .phpt } $_SESSION['states'] = $states; $_SESSION['filebase'] = $filebase; $_SESSION['relat'] = $relat; -$out = buildSummaryTable($states, $relat, $filebase); +$summary = buildSummary($relat); +echo $summary; + +$out = buildSummaryTable($states, $relat, $filebase, $committedTests); echo $out; -function buildSummaryTable($states, $relat, $filebase) { +function buildSummary($relat) { +$groups = array(); +foreach($relat as $testname) { + preg_match("/.*_(\w+)$/", $testname, $matches); + $groupName = $matches[1]; + if(isset($groups[$groupName])) { + $groups[$groupName] ++; + } else { + $groups[$groupName] = 1; + } + } +$htmlString = "<h2> Break down of tests by PHP User Group </h2>"; +$totalTests = 0; +foreach ($groups as $groupName => $numberOfTests) { + $totalTests += $numberOfTests; + $htmlString .= "Tests from group $groupName = $numberOfTests<br>"; +} +$htmlString .= "<br><b>Total tests contributed = $totalTests</b><br><br>"; + +return $htmlString; +} + + + +function buildSummaryTable($states, $relat, $filebase, $committedTests) { $htmlString = "<table class=\"resultTable\">"; - $htmlString .= "<th>TestName</th><th>PHP52</th><th>PHP53</th><th>PHP6</th>"; + $htmlString .= "<th>TestName</th><th>PHP52</th><th>PHP53</th><th>PHP6</th><th>CVS?</th>"; foreach($relat as $testname) { $s52 = $states[$testname]['php5.2']; - if($s52 == 'FAIL') { $basename = $filebase[$testname]['php5.2']; - $ref = 'failedfilelist.php?basename='.$basename; - $s52 = "<a href=$ref>X</a><br>"; - } + $ref = 'filelist.php?basename='.$basename; + $s52 = "<a href=$ref>$s52</a><br>"; $s53 = $states[$testname]['php5.3']; - if($s53 == 'FAIL') { $basename = $filebase[$testname]['php5.3']; - $ref = 'failedfilelist.php?basename='.$basename; - $s53 = "<a href=$ref>X</a><br>"; - } + $ref = 'filelist.php?basename='.$basename; + $s53 = "<a href=$ref>$s53</a><br>"; $s60 = $states[$testname]['php6.0']; - if($s60 == 'FAIL') { $basename = $filebase[$testname]['php6.0']; - $ref = 'failedfilelist.php?basename='.$basename; - $s60 = "<a href=$ref>X</a><br>"; - } + $ref = 'filelist.php?basename='.$basename; + $s60 = "<a href=$ref>$s60</a><br>"; + if(in_array($testname, $committedTests)) { + $committed = "<img src=\"tick.gif\">"; + } else { + $committed = "N"; + } - $htmlString .= "<tr><td>$testname</td><td>$s52</td><td>$s53</td><td>$s60</td></tr>"; + $htmlString .= "<tr><td>$testname</td><td>$s52</td><td>$s53</td><td>$s60</td><td>$committed</td></tr>"; } $htmlString .= "</table>"; return $htmlString; http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php?r1=1.2&r2=1.3&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php diff -u php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php:1.2 php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php:1.3 --- php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php:1.2 Sat May 9 15:29:42 2009 +++ php-testfest-web/scripts/testfestsource/src/testfesthourlytest.php Mon May 18 16:10:59 2009 @@ -14,6 +14,7 @@ $rootDir = "/home/testfestreports"; $svnCheckOutDir = $rootDir."/svnCheckOutDir"; +$cvsCheckOutDir = $rootDir."/cvsCheckOutDir/php5"; $phpBuildDir = $rootDir."/phpBuildDir"; @@ -31,10 +32,13 @@ if(!is_dir($svnCheckOutDir)) { $testSetup->checkOut(); } else { - echo "updating\n"; + echo "updating SVN\n"; $testSetup->update(); } +//set enviroment variable needed for CURL tests. Better not to do this, shoudl have an --ENV-- section & --SKIPIF-- +putenv('PHP_CURL_HTTP_REMOTE_SERVER=http://results.testfest.php.net'); + $testSetup->setFilesToCopy(); $filesToCopy = $testSetup->getFilesToCopy(); @@ -48,7 +52,7 @@ $from = trim($svnCheckOutDir."/testfest/".$file); $destFile = $testSetup->targetFileName($file); $to = $testRunDir."/".$dir."/".$destFile; - echo "Copy $from to $to\n"; + // echo "Copy $from to $to\n"; shell_exec("cp $from $to"); } } @@ -61,10 +65,11 @@ $results = shell_exec("$phpExecutable -n $run_tests -n -p $phpExecutable $testDir"); file_put_contents($testDir."/results", $results); } +//check to see what has already been committed - just does a 5.3 check an gets a list of files that +// have been copied to CVS - - - - - +$cvsChecker = new tmCvsCheck($testRunDir . "/php5.3", $cvsCheckOutDir); +$commitList = $cvsChecker->makeCommitList(); +$commitString = implode("\n", $commitList); +file_put_contents($testRunDir . "/commits", $commitString); ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/viewfilecontents.php?r1=1.2&r2=1.3&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/viewfilecontents.php diff -u php-testfest-web/scripts/testfestsource/src/viewfilecontents.php:1.2 php-testfest-web/scripts/testfestsource/src/viewfilecontents.php:1.3 --- php-testfest-web/scripts/testfestsource/src/viewfilecontents.php:1.2 Sat May 9 15:29:42 2009 +++ php-testfest-web/scripts/testfestsource/src/viewfilecontents.php Mon May 18 16:10:59 2009 @@ -31,9 +31,8 @@ echo "<br><b>File:".$file."</b><br><br>"; $file = realpath($file); - -if (strpos($file, '/var/www/html/publishresults/') !== 0) { - echo "Test file outside expected path<br />"; +if (strpos($file, '/p2/var/www/results.testfest.php.net/public_html/publishresults/') !== 0) { + echo "Test file $file outside expected path<br />"; } else { $contents = file($file); @@ -42,7 +41,7 @@ } } -echo "<br /><br /><a href='failedfilelist.php?basename=$basename'>Back to file list</a><br />"; +echo "<br /><br /><a href='filelist.php?basename=$basename'>Back to file list</a><br />"; ?> </body> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/tmClassMap.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/tmClassMap.php diff -u php-testfest-web/scripts/testfestsource/src/tmClassMap.php:1.1 php-testfest-web/scripts/testfestsource/src/tmClassMap.php:1.2 --- php-testfest-web/scripts/testfestsource/src/tmClassMap.php:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/tmClassMap.php Mon May 18 16:10:59 2009 @@ -1,5 +1,6 @@ <?php $tmClassMap = array( + 'tmCvsCheck' => 'testsetup/tmCvsCheck.php', 'tmExtractTests' => 'testsetup/tmExtractTests.php', 'tmGetPhp' => 'testsetup/tmGetPhp.php', 'tmUnixGetPhp' => 'testsetup/unix/tmUnixGetPhp.php', http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php diff -u php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php:1.1 php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php:1.2 --- php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/testsetup/tmExtractTests.php Mon May 18 16:10:59 2009 @@ -23,7 +23,7 @@ public function update() { $current = realpath(getcwd()); - chdir($this->svnTestLocation."/".testfest); + chdir($this->svnTestLocation."/testfest"); shell_exec("svn update"); chdir($current); } @@ -42,6 +42,7 @@ $incFiles = explode('./', $fileList); $relNamesToCopy = array_merge($phptFiles, $incFiles); + //remove any bogus entries foreach ($relNamesToCopy as $filename) { $filename = trim($filename); @@ -58,6 +59,8 @@ public function targetFileName($name) { if(preg_match('/(\w+)\/(.*).phpt/', $name, $matches)) { $target = $matches[2]."_".$matches[1].".phpt"; + } else if(preg_match('/(\w+)\/(.*).inc/', $name, $matches)) { + $target = $matches[2].".inc"; } else { $target = $name; } http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/README?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/README diff -u php-testfest-web/scripts/testfestsource/README:1.1 php-testfest-web/scripts/testfestsource/README:1.2 --- php-testfest-web/scripts/testfestsource/README:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/README Mon May 18 16:10:59 2009 @@ -1,36 +1,57 @@ -These are the scripts that extract tests from SVN, run them and display the results. They expect -a specific directory structure. -testfestroot - /phpBuildDir (create in advance) - /svnCheckOutDir (this will be created the first time you run testfesthourly.php) - /testRunDir (create this AND subdirectories in advance, use make_test_directories.sh). - /php5.2 - /php5.3 - /php6.0 +Server names currently in use +============================= -Then modify teh code to set the $rootDir - -The web site is: http://testfest.php.net/displayresults.php +http://results.testfest.php.net/displayresults.php 1) There is a PHP script to extract and build PHP once a day. /home/zoe/testfestsource/src/testfestdaily.php -Currently fails to build a working PHP 6 but is OK for the others. This is not in cron yet. 2) Script to update SVN, copy the phpt files out to run directoris, run them against 52, 53 and 6. /home/zoe/testfestsource/src/testfesthourly.php -Runs once an hour. See /etc/cron.hourly to set it up. (/sbin/service crond status|stop|start). +Runs once an hour, 20 mins past. 3) shell script to publish the results /home/zoe/testfestsource/src/publishresults.sh -Runs once an hour AFTER above. +Published once an hour at 40 minutes past. + +4) Three files in /var/www/html +displayresults.php, viewcontents.php, filelist.php + +5) The results are published in /var/www/server-doc-root/publishresults -4) Three files need to be copied to in /var/www/html -displayresults.php, viewcontents.php, failedfilelist.php +Steps in deploying the scripts on a new *ix server, assume xxx is your UID -5) The results are published in /var/www/html/publishresults which also needs to be created in advance +0. Create a tar file of everything under the testfest directory. +1. Copy the tar of all the source into /home/xxx on teh server you want to deploy on +2. Create /home/testfestreports/phpBuildDir (allow writes to it) + sudo chown -R xxx testfestreports +3. Run /home/zoe/testfestsource/src/testfestdaily.php to download and build PHP + Check the config options in src/testsetup/unix/tmUnixGetPhp.php, you may need to install stuff +4. Create /home/testfestreports/cvsCheckoutDir +5. In cvsCheckoutDir, + cvs -d :pserver:cvsread@cvs.php.net:/repository login + password: phpfi + cvs -d :pserver:cvsread@cvs.php.net:/repository checkout -r PHP_5_3 php5 +6. Create /home/testfestreports/testRunDir + create sub directories php5.2, php5.3, php6.0 + create a source tree in each using make_test_directories.sh +7. Run phptestfesthourly.php. This will create the final directory (/home/testfestreports/svnCheckoutDir) and fetch a copy of the test cases. +8. Create new Vhost (see /etc/apache), the one on sp1 is called results.testfest.php.net +9. Make its doc root somewhere under /var/www (ex /var/www/results.testfest.php.net/public_html) +10. Modify publishresults.sh to point to the right dir under doc root +11. cd /var/www/results.testfest.php.net/public_html/; sudo mkdir publishresults +12. copy displayresults.php /var/www/results.testfest.php.net/public_html, and viewfilecontents and filelist. +13 copy the PhpTestFestRegistration.css and tick.gif across too +14. Check/fix some paths in displayresults.php and viewfilecontents +15. Setup three cron jobs. As user xxx: + run hourlyrun once every hour + run dailybuild once every day + As root: + run hourlypublish (20 minutes after hourly run) +16. Copy get.php into public.html directory (this is so that the curl tests run. Modify the CURL responder in hourly php script too) http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php?r1=1.1&r2=1.2&diff_format=u Index: php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php diff -u php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php:1.1 php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php:1.2 --- php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php:1.1 Wed May 6 18:29:06 2009 +++ php-testfest-web/scripts/testfestsource/src/testsetup/unix/tmUnixGetPhp.php Mon May 18 16:10:59 2009 @@ -47,8 +47,11 @@ public function buildPHP ($buildsDir) { $configure_flags = ""; + //Note that php6.0 does not build with intl on this machine. if(substr($this->buildType, -strlen('6.0')) == '6.0') { - $configure_flags .= "--with-icu-dir=/home/testfestreports/phpBuildDir/ICU-install"; + $configure_flags .= "--with-icu-dir=/usr/local --with-gettext --with-ldap --with-xsl --enable-sockets --with-tidy --with-zlib=/usr --enable-json --with-imap=/usr --with-kerberos --with-imap-ssl=/usr --enable-pcntl --enable-ftp --with-curl=/usr"; + } else { + $configure_flags .= "--enable-intl --with-gettext --with-ldap --with-xsl --enable-sockets --with-tidy --with-zlib=/usr --enable-json --with-imap=/usr --with-kerberos --with-imap-ssl=/usr --enable-pcntl --enable-ftp --with-curl=/usr"; } $current = realpath(getcwd()); chdir($buildsDir."/".$this->buildType); http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/get.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/get.php +++ php-testfest-web/scripts/testfestsource/src/get.php <?php switch($_GET['test']) { case 'post': var_dump($_POST); break; case 'getpost': var_dump($_GET); var_dump($_POST); break; case 'referer': echo $_SERVER['HTTP_REFERER']; break; case 'useragent': echo $_SERVER['HTTP_USER_AGENT']; break; default: echo "Hello World!\n"; echo "Hello World!"; break; } ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/PhpTestFestRegistration.css?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/PhpTestFestRegistration.css +++ php-testfest-web/scripts/testfestsource/src/PhpTestFestRegistration.css body { padding-left: 11em; font-family: Georgia, "Times New Roman", Times, serif; color: #b9484a; background-color: #89df00 } ul.navbar { list-style-type: none; padding: 0; margin: 0; position: absolute; top: 2em; left: 1em; width: 9em } h1 { font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif } ul.navbar li { background: white; margin: 0.5em 0; padding: 0.3em; border-right: 1em solid black } ul.navbar a { text-decoration: none } a:link { color: blue } a:visited { color: purple } address { margin-top: 1em; padding-top: 1em; border-top: thin dotted } table.resultTable { width: 70%; padding: 0px; border: none; border: 1px solid #b944a4;} table.resultTable th { font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #1D1AB2; border-right: 2px solid #2b8a3b; border-bottom: 2px solid #2b8a3b; border-top: 2px solid #2b8a3b; letter-spacing: 2px; text-transform: uppercase; text-align: left; padding: 6px 6px 6px 6px; } table.resultTable td { border-right: 2px solid #2b8a3b; border-bottom: 2px solid #2b8a3b; background: #fff; padding: 6px 6px 6px 6px; color: #323086; } table.resultTable tr.special td { background: #2b8a3b; } http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/make_test_directories.sh?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/make_test_directories.sh +++ php-testfest-web/scripts/testfestsource/src/make_test_directories.sh mkdir -p ext/date/tests mkdir -p ext/simplexml/tests mkdir -p ext/pdo_pgsql/tests mkdir -p ext/json/tests mkdir -p ext/tokenizer/tests mkdir -p ext/shmop/tests mkdir -p ext/wddx/tests mkdir -p ext/sybase_ct/tests mkdir -p ext/dba/tests mkdir -p ext/pspell/tests mkdir -p ext/pdo_odbc/tests mkdir -p ext/mysqli/tests mkdir -p ext/sqlite3/tests mkdir -p ext/tidy/tests mkdir -p ext/sysvsem/tests mkdir -p ext/sqlite/tests mkdir -p ext/sqlite/tests/pdo mkdir -p ext/curl/tests mkdir -p ext/sysvmsg/tests mkdir -p ext/pdo_firebird/tests mkdir -p ext/bcmath/tests mkdir -p ext/phar/tests mkdir -p ext/phar/tests/cache_list mkdir -p ext/phar/tests/zip mkdir -p ext/phar/tests/tar mkdir -p ext/fileinfo/tests mkdir -p ext/mysql/tests mkdir -p ext/exif/tests mkdir -p ext/spl/examples/tests mkdir -p ext/spl/tests mkdir -p ext/pcre/tests mkdir -p ext/soap/tests mkdir -p ext/soap/tests/soap12 mkdir -p ext/soap/tests/interop/Round3/GroupD mkdir -p ext/soap/tests/interop/Round3/GroupE mkdir -p ext/soap/tests/interop/Round3/GroupF mkdir -p ext/soap/tests/interop/Round4/GroupI mkdir -p ext/soap/tests/interop/Round4/GroupH mkdir -p ext/soap/tests/interop/Round2/GroupB mkdir -p ext/soap/tests/interop/Round2/Base mkdir -p ext/soap/tests/schema mkdir -p ext/soap/tests/bugs mkdir -p ext/calendar/tests mkdir -p ext/ftp/tests mkdir -p ext/pdo_mysql/tests mkdir -p ext/ctype/tests mkdir -p ext/mbstring/tests mkdir -p ext/libxml/tests mkdir -p ext/ldap/tests mkdir -p ext/reflection/tests mkdir -p ext/enchant/tests mkdir -p ext/xmlreader/tests mkdir -p ext/standard/tests/filters mkdir -p ext/standard/tests/versioning mkdir -p ext/standard/tests/serialize mkdir -p ext/standard/tests/general_functions mkdir -p ext/standard/tests/assert mkdir -p ext/standard/tests/url mkdir -p ext/standard/tests/streams mkdir -p ext/standard/tests/array mkdir -p ext/standard/tests/mail mkdir -p ext/standard/tests/class_object mkdir -p ext/standard/tests/file mkdir -p ext/standard/tests/directory mkdir -p ext/standard/tests/time mkdir -p ext/standard/tests/math mkdir -p ext/standard/tests/image mkdir -p ext/standard/tests/dir mkdir -p ext/standard/tests/misc mkdir -p ext/standard/tests/strings mkdir -p ext/standard/tests/network mkdir -p ext/pcntl/tests mkdir -p ext/imap/tests mkdir -p ext/gmp/tests mkdir -p ext/sockets/tests mkdir -p ext/session/tests mkdir -p ext/hash/tests mkdir -p ext/posix/tests mkdir -p ext/bz2/tests mkdir -p ext/zip/tests mkdir -p ext/mcrypt/tests mkdir -p ext/pdo_sqlite/tests mkdir -p ext/sysvshm/tests mkdir -p ext/com_dotnet/tests mkdir -p ext/iconv/tests mkdir -p ext/xml/tests mkdir -p ext/zlib/tests mkdir -p ext/xmlrpc/tests mkdir -p ext/dom/tests mkdir -p ext/xsl/tests mkdir -p ext/readline/tests mkdir -p ext/pgsql/tests mkdir -p ext/gd/tests mkdir -p ext/intl/tests mkdir -p ext/pdo/tests mkdir -p ext/pdo_oci/tests mkdir -p ext/gettext/tests mkdir -p ext/openssl/tests mkdir -p ext/ereg/tests mkdir -p ext/oci8/tests mkdir -p ext/filter/tests mkdir -p ext/interbase/tests mkdir -p ext/skeleton/tests mkdir -p ext/xmlwriter/tests mkdir -p Zend/tests mkdir -p Zend/tests/multibyte mkdir -p Zend/tests/constants mkdir -p tests/lang mkdir -p tests/output mkdir -p tests/security mkdir -p tests/func mkdir -p tests/basic mkdir -p tests/run-test mkdir -p tests/strings mkdir -p tests/classes mkdir -p sapi/cli/tests mkdir -p sapi/tests mkdir -p sapi/cgi/tests http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/killcurl.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/killcurl.php +++ php-testfest-web/scripts/testfestsource/src/killcurl.php <?php $processes = shell_exec("ps -ef | grep Paris"); $process_list = explode("risUG.php", $processes); foreach ($process_list as $line) { if (preg_match("#zoe\s+(\d+)\s+.*Pa$#", $line, $matches)) { shell_exec("kill " . $matches[1]); } } ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/extractteststest.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/extractteststest.php +++ php-testfest-web/scripts/testfestsource/src/extractteststest.php <?php require_once dirname(__FILE__) . '/tmAutoload.php'; $repositoryPath = "http://89.151.87.83/repos/testfest"; //Setup $rootDir = "/home/testfestreports"; $svnCheckOutDir = $rootDir."/svnCheckOutDir"; $cvsCheckOutDir = $rootDir."/cvsCheckOutDir/php5"; $phpBuildDir = $rootDir."/phpBuildDir"; $testRunDir = $rootDir."/testRunDir"; $phpVersion = array( 'php6.0', 'php5.3', 'php5.2', ); //Script sould run once an hour. Relies on having PHP builds in the right place $testSetup = new tmExtractTests($repositoryPath, $svnCheckOutDir); $testSetup->setFilesToCopy(); $filesToCopy = $testSetup->getFilesToCopy(); var_dump($filesToCopy); //copy all the files into a directory thay can be run from foreach($phpVersion as $dir) { //remove .phpt files from last run, necessary of people have moved things around in SVN. shell_exec("find $testRunDir/$dir -name \"*.phpt\" | xargs -i rm {}"); foreach ($filesToCopy as $file) { $from = trim($svnCheckOutDir."/testfest/".$file); $destFile = $testSetup->targetFileName($file); $to = $testRunDir."/".$dir."/".$destFile; echo "Copy $from to $to\n"; // shell_exec("cp $from $to"); } } ?> ?> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/filelist.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/filelist.php +++ php-testfest-web/scripts/testfestsource/src/filelist.php <?php session_start()?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <link rel="stylesheet" href="PhpTestFestRegistration.css"> <head> <title>Output files</title> </head> <body> <?php $rootDir = "/home/testfestreports"; $svnCheckOutDir = $rootDir."/svnCheckOutDir"; $phpBuildDir = $rootDir."/phpBuildDir"; $testRunDir = $rootDir."/testRunDir"; $phpVersion = array( 'php6.0', 'php5.3', //'php5.2', ); $base = $_GET['basename']; //$base = preg_replace('#[^a-z_-.]#', '', $base); $base = preg_replace('#[^a-z0-9_\-\.\/]#i', '', $base); $_SESSION['basename'] = $base; $expFile = $base.".exp"; $outFile = $base.".out"; $difFile = $base.".diff"; $phptFile = $base.".phpt"; $phpFile = $base.".php"; echo "<br><br><b>Output files for test: $base.phpt</b><br><br>"; echo "<b>View test case source: </b> <br>"; echo "<a href=viewfilecontents.php?file=".$phptFile.">Test file</a><br>"; echo "<br><b>Check these if the test has failed: </b> <br>"; echo "<a href=viewfilecontents.php?file=".$outFile.">Actual output</a><br>"; echo "<a href=viewfilecontents.php?file=".$expFile.">Expected output</a><br>"; echo "<a href=viewfilecontents.php?file=".$difFile.">Difference</a><br>"; echo "<a href=viewfilecontents.php?file=".$phpFile.">PHP</a><br>"; echo "<br><br><a href=displayresults.php>Back to results table</a><br>"; ?> </body> </html> http://cvs.php.net/viewvc.cgi/php-testfest-web/scripts/testfestsource/src/testsetup/tmCvsCheck.php?view=markup&rev=1.1 Index: php-testfest-web/scripts/testfestsource/src/testsetup/tmCvsCheck.php +++ php-testfest-web/scripts/testfestsource/src/testsetup/tmCvsCheck.php <?php class tmCvsCheck { protected $cvsDir; protected $runDir; protected $fileList = array(); protected $normalisedFileNames = array(); protected $relativeFileNames = array(); public function __construct($runDir, $cvsDir) { $this->runDir = $runDir; $this->cvsDir = $cvsDir; $this->getFiles(); $this->cvsUp(); $this->normaliseFileNames(); } public function cvsUp() { $current = realpath(getcwd()); chdir($this->cvsDir); shell_exec("cvs up"); chdir($current); } public function getFiles() { $fileString = shell_exec("find $this->runDir -name \"*.phpt\" -print"); foreach(explode("\n", $fileString) as $file) { if (substr($file, -strlen(".phpt")) == ".phpt") { $this->fileList[] = $file; } } } public function normaliseFileNames() { foreach ($this->fileList as $fileName) { if(preg_match("#$this->runDir(.*)(_\w+\.phpt)$#", $fileName, $matches)) { $this->normalisedFileNames[] = $matches[1] . ".phpt"; $this->relativeFileNames[] = $matches[1] . $matches[2]; } } } public function isCommitted($name) { if(file_exists($this->cvsDir . "/" . $name)) { return true; } return false; } public function makeCommitList() { $committed = array(); for($i = 0; $i < count($this->fileList); $i++) { $file = $this->normalisedFileNames[$i]; if($this->isCommitted($file)) { $committed[] = $this->relativeFileNames[$i]; } } return $committed; } } ?>