[git] web/qa.git branch master updated. 9a75747
| From: | odoucet@php.net | Date: | Sat, 03 Mar 2012 14:10:04 +0000 |
| Subject: | [git] web/qa.git branch master updated. 9a75747 | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66122@lists.php.net to get a copy of this message | ||
The branch, master on web/qa.git has been updated
via 9a75747f853a3be54cfd6bd0ac6d63b3be9da4c4 (commit)
from 0ccc067b9dd74db46533d9d4d9e2a5e23cf477e1 (commit)
http://git.php.net/?p=web/qa.git;a=log;h=9a75747f853a3be54cfd6bd0ac6d63b3be9da4c4;hp=0ccc067b9dd74db46533d9d4d9e2a5e23cf477e1
Summary of changes:
reports/README | 67 +++++++++++++++++++++++++++++++++++++++++++++++
reports/details.php | 3 +-
reports/parserfunc.php | 2 +-
reports/test-insert.php | 25 ++++++++++-------
4 files changed, 84 insertions(+), 13 deletions(-)
create mode 100644 reports/README
-- Log ----------------------------------------
commit 9a75747f853a3be54cfd6bd0ac6d63b3be9da4c4
Author: Olivier Doucet <odoucet@php.net>
Date: Sat Mar 3 15:00:52 2012 +0100
Reworked qa report test script
added README file with explanations on how the report interface works
small fix in QA report parser
diff --git a/reports/README b/reports/README
new file mode 100644
index 0000000..498d575
--- /dev/null
+++ b/reports/README
@@ -0,0 +1,67 @@
+Database format
+---------------
+In db/ folder, there is one file for each PHP version.
+The sqlite files CANNOT be access directly (forced to use the report interface).
+
+Each sqlite file has the following schema :
+
+CREATE TABLE failed (
+
id integer PRIMARY KEY AUTOINCREMENT,
+ id_report bigint(20) NOT NULL,
+ test_name varchar(128) NOT NULL,
+ output STRING NOT NULL,
+ diff STRING NOT NULL,
+ signature binary(16) NOT NULL
+)
+CREATE TABLE reports (
+ id integer primary key AUTOINCREMENT,
+ date datetime NOT NULL,
+ status smallint(1) not null,
+ nb_failed unsigned int(10) NOT NULL,
+ nb_expected_fail unsigned int(10) NOT NULL,
+ build_env STRING NOT NULL,
+ phpinfo STRING NOT NULL,
+ user_email varchar(64) default null
+)
+
+The SQLite file is created in parserfunc.php:insertToDb_phpmaketest()
+if the sqlite file '$VERSION.sqlite' does not exist.
+
+Each report adds a line in reports table with the following fields :
+ - id : integer auto incremented
+ - date : date the report was sent
+ - status : 0 = failed, 1 = success. If status is something else (should not !), we exit()
+ - nb_failed : number of tests failed
+ - nb_expected_fail : number of expected failed tests
+ - build_env : build environment
+ - phpinfo : phpinfo() output
+ - user_email : email mangled (user at domain dot com)
+
+Then, for each failed test, we add a line in failed table :
+ - id : integer auto increment
+ - id_report : id of the report
+ - test_name : path of the test. Example : "/ext/hash/tests/mhash_001.phpt"
+ - output : full output of test
+ - diff : diff of test compared to what was expected. There may be some glitches with spaces and %s
+ - signature : binary(16) built with md5($name.'__'.$test['diff'])
+ In URLs, the binary md5 is transformed as base64 (like 03410e89b1d2737ce178a795f298ae64).
+ It is used to track differencies between each failed test in DB : we compare only the signature,
+ which is simpler than checking every diff.
+
+
+When do we have new reports ?
+-----------------------------
+When you do a 'make test' on your PHP sourcedir, you can send a report when something
went wrong.
+If you do this, the test program will build a flat file containing all failed tests output/diff
+and send it to http://qa.php.net/buildtest-process.php (via POST
method).
+Previously, this page only sent the report to a dedicated mailing list (qa-reports at
lists.php.net).
+We now add a parser that intercept the data and send it to the function located in
+reports/parserfunc.php:parse_phpmaketest()
+This function transforms (with much regexp) the data (a big string in php format) to an array.
+This array is then given to reports/parserfunc.php:insertToDb_phpmaketest() that insert it to the
+sqlite file for this PHP version.
+
+
+What's planned ?
+----------------
+So much to do... and so little time (Batman). Please take a look at todo.txt
diff --git a/reports/details.php b/reports/details.php
index c49b320..41cfe12 100644
--- a/reports/details.php
+++ b/reports/details.php
@@ -118,5 +118,6 @@ if (isset($_GET['idreport'])) {
echo '</div>';
-$SITE_UPDATE = "<br /> Generated in
".round((microtime(true)-$startTime)*1000)." ms";
+$SITE_UPDATE = date('D M d H:i:s Y T', filemtime($dbFile)).
+ "<br /> Generated in
".round((microtime(true)-$startTime)*1000)." ms";
common_footer();
diff --git a/reports/parserfunc.php b/reports/parserfunc.php
index 0dbfb0f..ffa4288 100644
--- a/reports/parserfunc.php
+++ b/reports/parserfunc.php
@@ -213,7 +213,7 @@ function parse_phpmaketest($version, $status, $file)
$output = explode("\n", $output);
foreach ($output as $row) {
- if (preg_match('@^={5,}$@', $row)) {
+ if (preg_match('@^={5,}(\s)?$@', $row)) {
if ($outputTest != '') $startDiff = true;
} elseif ($startDiff === false) {
diff --git a/reports/test-insert.php b/reports/test-insert.php
index 0cdd690..a045a56 100644
--- a/reports/test-insert.php
+++ b/reports/test-insert.php
@@ -16,7 +16,10 @@
# +----------------------------------------------------------------------+
# $Id$
+error_reporting(E_ALL);
+
require 'parserfunc.php';
+require '../include/functions.php';
echo '<h1>Testing QA report parsing and database handling</h1>';
echo '<pre>'."\n";
@@ -63,22 +66,22 @@ else echo " <font color='red'>KO</font> \n";
printf("%-30s", "specific test diff");
$strlen = strlen($array['tests']['/tests/func/010.phpt']['diff']);
if (isset($array['tests']['/tests/func/010.phpt']['diff']) &&
$strlen >= 290 )
- echo " <font color='green'>OK (size: ".$strlen." ) -
optimal==293</font> \n";
-else echo " <font color='red'>KO</font> \n";
+ echo " <font color='green'>OK size: ".$strlen." - optimal =
293</font> \n";
+else echo " <font color='red'>KO (length: $strlen should be >
290)</font> \n";
printf("%-30s", "specific test output");
$strlen = strlen($array['tests']['/tests/func/010.phpt']['output']);
if (isset($array['tests']['/tests/func/010.phpt']['output'])
&& $strlen >= 165 )
- echo " <font color='green'>OK (size: ".$strlen." ) -
optimal==167</font> \n";
+ echo " <font color='green'>OK size: ".$strlen." - optimal =
167</font> \n";
else echo " <font color='red'>KO</font> \n";
printf("%-30s", "phpinfo");
-if (strlen($array['phpinfo']) >= 27940) echo " <font
color='green'>OK (size: ".strlen($array['phpinfo']).")</font>
\n";
+if (strlen($array['phpinfo']) >= 27940) echo " <font
color='green'>OK size: ".strlen($array['phpinfo'])."</font>
\n";
else echo " <font color='red'>KO</font> \n";
printf("%-30s", "buildEnvironment");
if (strlen($array['buildEnvironment']) >= 4500)
- echo " <font color='green'>OK (size:
".strlen($array['buildEnvironment']).")</font> \n";
+ echo " <font color='green'>OK size:
".strlen($array['buildEnvironment'])."</font> \n";
else echo " <font color='red'>KO</font> \n";
// total diff / output, to see if we parsed everything Ok
@@ -91,11 +94,11 @@ foreach ($array['tests'] as $name => $content) {
}
printf("%-30s", "Total diff length");
-if ($totalDiff >= 27900) echo " <font color='green'>OK (size:
".$totalDiff." - optimal = 27938)</font> \n";
+if ($totalDiff >= 27900) echo " <font color='green'>OK size:
".$totalDiff." - optimal = 27938</font> \n";
else echo " <font color='red'>KO</font> \n";
printf("%-30s", "Total output length");
-if ($totalOutput >= 31950) echo " <font color='green'>OK (size:
".$totalOutput." - optimal = 31971)</font> \n";
+if ($totalOutput >= 31950) echo " <font color='green'>OK size:
".$totalOutput." - optimal = 31971</font> \n";
else echo " <font color='red'>KO</font> \n";
@@ -150,13 +153,13 @@ if (count($sqlFailed) == 33) {
printf("%-30s", "specific test diff");
$strlen = strlen($sqlFailed['/tests/func/010.phpt']['diff']);
if (isset($sqlFailed['/tests/func/010.phpt']['diff']) && $strlen >=
290 )
- echo " <font color='green'>OK (size: ".$strlen." ) -
optimal==293</font> \n";
+ echo " <font color='green'>OK size: ".$strlen." - optimal =
293</font> \n";
else echo " <font color='red'>KO</font> \n";
printf("%-30s", "specific test output");
$strlen = strlen($sqlFailed['/tests/func/010.phpt']['output']);
if (isset($sqlFailed['/tests/func/010.phpt']['output']) && $strlen
>= 165 )
- echo " <font color='green'>OK (size: ".$strlen." ) -
optimal==167</font> \n";
+ echo " <font color='green'>OK size: ".$strlen." - optimal =
167</font> \n";
else echo " <font color='red'>KO</font> \n";
$totalDiff = 0;
@@ -168,11 +171,11 @@ foreach ($sqlFailed as $name => $content) {
}
printf("%-30s", "Total diff length");
-if ($totalDiff >= 27900) echo " <font color='green'>OK (size:
".$totalDiff." - optimal = 27938)</font> \n";
+if ($totalDiff >= 27900) echo " <font color='green'>OK size:
".$totalDiff." - optimal = 27938</font> \n";
else echo " <font color='red'>KO</font> \n";
printf("%-30s", "Total output length");
-if ($totalOutput >= 31950) echo " <font color='green'>OK (size:
".$totalOutput." - optimal = 31971)</font> \n";
+if ($totalOutput >= 31950) echo " <font color='green'>OK size:
".$totalOutput." - optimal = 31971</font> \n";
else echo " <font color='red'>KO</font> \n";
// Cleanup
Thank you for your contribution.