cvs: php-gcov-web /cron cron.php graph.php /cron/sql sample.sql tables.sql /www stats.php

From: Date: Fri, 29 Dec 2006 23:28:45 +0000
Subject: cvs: php-gcov-web /cron cron.php graph.php /cron/sql sample.sql tables.sql /www stats.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-33631@lists.php.net to get a copy of this message
nlopess Fri Dec 29 23:28:45 2006 UTC Removed files: /php-gcov-web/cron/sql sample.sql Modified files: /php-gcov-web/cron cron.php graph.php /php-gcov-web/www stats.php /php-gcov-web/cron/sql tables.sql Log: allow NULL in some columns of the DB when the build fails http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.php?r1=1.6&r2=1.7&diff_format=u Index: php-gcov-web/cron/cron.php diff -u php-gcov-web/cron/cron.php:1.6 php-gcov-web/cron/cron.php:1.7 --- php-gcov-web/cron/cron.php:1.6 Sun Dec 24 17:19:17 2006 +++ php-gcov-web/cron/cron.php Fri Dec 29 23:28:45 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cron.php,v 1.6 2006/12/24 17:19:17 nlopess Exp $ */ +/* $Id: cron.php,v 1.7 2006/12/29 23:28:45 nlopess Exp $ */ if ($argc != 7) @@ -41,8 +41,8 @@ $totalnumerrors = 0; // Total number of errors (compile_errors.php) $totalnumwarnings = 0; // Total number of warnings (compile_errors.php) -$totalnumleaks = 0; // Total number of memory leaks (valgrind.php) -$totalnumfailures = 0; // Total number of test failures (tests.php) +$totalnumleaks = NULL; // Total number of memory leaks (valgrind.php) +$totalnumfailures = NULL; // Total number of test failures (tests.php) $configureinfo = 'N/A'; // Information regarding configure (system.php) @@ -50,9 +50,7 @@ $osinfo = 'N/A'; // Information regarding operating system (system.php) -$valgrindinfo = 'N/A'; // Information regarding valgrind (system.php) - -$codecoverage_percent = -1; // Information regarding the code coverage +$codecoverage_percent = NULL; // Information regarding the code coverage $version_id = 0; // Start by assuming the version_id is unknown @@ -187,7 +185,6 @@ <compiler>$compilerinfo</compiler> <configure>$configureinfo</configure> <os>$osinfo</os> -<valgrind>$valgrindinfo</valgrind> </buildinfo> <builddata> XML; http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/graph.php?r1=1.5&r2=1.6&diff_format=u Index: php-gcov-web/cron/graph.php diff -u php-gcov-web/cron/graph.php:1.5 php-gcov-web/cron/graph.php:1.6 --- php-gcov-web/cron/graph.php:1.5 Tue Dec 19 19:20:05 2006 +++ php-gcov-web/cron/graph.php Fri Dec 29 23:28:45 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: graph.php,v 1.5 2006/12/19 19:20:05 nlopess Exp $ */ +/* $Id: graph.php,v 1.6 2006/12/29 23:28:45 nlopess Exp $ */ // File to generate graphs for a weekly or monthly basis @@ -26,8 +26,7 @@ Inportant Notes: * We select the average number of each of the four criteria with the limitation of one data point -* allowed per period (day/month), excluding the coverage, where we select the max value (mainly -* because of possible -1 values) +* allowed per period (day/month) * Graphs can only be generated for the period of time if at least more than one data point exist * during that time frame. Otherwise an error would occur when starting the graph creation process. @@ -75,7 +74,7 @@ try { - $sql = "SELECT $sqlgroup(build_datetime), max(build_percent_code_coverage), avg(build_numwarnings), avg(build_numfailures), avg(build_numleaks) FROM local_builds WHERE DATE_SUB(CURDATE() , INTERVAL ? DAY) <= build_datetime AND version_id=? GROUP BY $sqlgroup(build_datetime)"; + $sql = "SELECT $sqlgroup(build_datetime), avg(build_percent_code_coverage), avg(build_numwarnings), avg(build_numfailures), avg(build_numleaks) FROM local_builds WHERE DATE_SUB(CURDATE() , INTERVAL ? DAY) <= build_datetime AND version_id=? GROUP BY $sqlgroup(build_datetime)"; $stmt = $mysqlconn->prepare($sql); $stmt->execute(array($graph_days, $version_id)); } @@ -116,17 +115,20 @@ $date = $date2text($date); - // Code Coverage less then 0 means could not be located - if($build_codecoverage >= 0) { + if ($build_codecoverage !== NULL) { $data_y['codecoverage'][] = $build_codecoverage; $data_x['codecoverage'][] = $date; } - $data_y['failures'][] = $build_numfailures; - $data_x['failures'][] = $date; + if ($build_numfailures !== NULL) { + $data_y['failures'][] = $build_numfailures; + $data_x['failures'][] = $date; + } - $data_y['memleaks'][] = $build_numleaks; - $data_x['memleaks'][] = $date; + if ($build_numleaks !== NULL) { + $data_y['memleaks'][] = $build_numleaks; + $data_x['memleaks'][] = $date; + } $data_y['warnings'][] = $build_numwarnings; $data_x['warnings'][] = $date; http://cvs.php.net/viewvc.cgi/php-gcov-web/www/stats.php?r1=1.1&r2=1.2&diff_format=u Index: php-gcov-web/www/stats.php diff -u php-gcov-web/www/stats.php:1.1 php-gcov-web/www/stats.php:1.2 --- php-gcov-web/www/stats.php:1.1 Fri Dec 29 23:01:04 2006 +++ php-gcov-web/www/stats.php Fri Dec 29 23:28:45 2006 @@ -54,20 +54,23 @@ HTML; if ($c_errors) { - $content .= "<b>Compile Errors:</b> $c_errors<br/>"; + $content .= "<b>Compile Errors:</b> $c_errors<br/>\n"; } $content .= <<< HTML <b>Compile Warnings:</b> $c_warns<br/> HTML; -if ($coverage != -1) { - $content .= "<b>Code Coverage:</b> $coverage%<br/>"; +if ($coverage !== NULL) { + $content .= "<b>Code Coverage:</b> $coverage%<br/>\n"; } -$content .= <<< HTML -<b>Test Failures:</b> $test_failures<br/> -<b>Valgrind Reports:</b> $valgrind<br/> -</p> -HTML; +if ($test_failures !== NULL) { + $content .= "<b>Test Failures:</b> $test_failures<br/>\n"; +} + +if ($valgrind !== NULL) { + $content .= "<b>Valgrind Reports:</b> $valgrind<br/>\n"; +} +$content .= "</p>\n"; http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/sql/tables.sql?r1=1.3&r2=1.4&diff_format=u Index: php-gcov-web/cron/sql/tables.sql diff -u php-gcov-web/cron/sql/tables.sql:1.3 php-gcov-web/cron/sql/tables.sql:1.4 --- php-gcov-web/cron/sql/tables.sql:1.3 Tue Dec 19 16:45:07 2006 +++ php-gcov-web/cron/sql/tables.sql Fri Dec 29 23:28:45 2006 @@ -16,16 +16,17 @@ CREATE TABLE local_builds ( build_id int(11) NOT NULL auto_increment, version_id int(11) NOT NULL, -build_datetime datetime NOT NULL default '2000-01-01 12:00:00', +build_datetime datetime NOT NULL, build_numerrors int(11) NOT NULL, build_numwarnings int(11) NOT NULL, -build_numfailures int(11) NOT NULL, -build_numleaks int(11) NOT NULL, -build_percent_code_coverage float NOT NULL, +build_numfailures int(11), +build_numleaks int(11), +build_percent_code_coverage float, build_os_info tinytext collate latin1_general_ci NOT NULL, build_compiler_info tinytext collate latin1_general_ci NOT NULL, PRIMARY KEY (build_id), -KEY version_id (version_id) +KEY version_id (version_id), +KEY build_datetime (build_datetime) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci COMMENT='Store local build statistics for graph building'; -- --------------------------------------------------------

« previous php.mirrors (#33631) next »