[llvm-commits] [nightly-test-server] r50030 - in /nightly-test-server/trunk: AcceptTestResults.php NightlyTestAccept.php
Tanya Lattner
tonic at nondot.org
Sun Apr 20 22:02:41 PDT 2008
Author: tbrethou
Date: Mon Apr 21 00:02:41 2008
New Revision: 50030
URL: http://llvm.org/viewvc/llvm-project?rev=50030&view=rev
Log:
Fixed errors that were freeing non existant mysql results.
Script no longer dies if it can not write build files.
Modified new database layout and updated insert statements.
Modified:
nightly-test-server/trunk/AcceptTestResults.php
nightly-test-server/trunk/NightlyTestAccept.php
Modified: nightly-test-server/trunk/AcceptTestResults.php
URL: http://llvm.org/viewvc/llvm-project/nightly-test-server/trunk/AcceptTestResults.php?rev=50030&r1=50029&r2=50030&view=diff
==============================================================================
--- nightly-test-server/trunk/AcceptTestResults.php (original)
+++ nightly-test-server/trunk/AcceptTestResults.php Mon Apr 21 00:02:41 2008
@@ -82,21 +82,25 @@
$dejagnuWallTime, $warnings, $warningsAdded,
$warningsRemoved, $cvsUsersAdd, $cvsUsersCO,
$cvsFilesAdded, $cvsFilesRemoved, $cvsFilesModified,
- $buildStatus) {
+ $buildStatus, $dejagnuPASS, $dejagnuXPASS,
+ $dejagnuFAIL, $dejagnuXFAIL) {
$sqlQuery = "INSERT into testRunInfo (runDateTime, machineId, machineUname," .
" gccVersion, cvsCpuTime, cvsWallTime, configureCpuTime," .
" configureWallTime, buildCpuTime, buildWallTime," .
" dejagnuCpuTime, dejagnuWallTime, warnings, warningsAdded," .
" warningsRemoved, cvsUsersAdd, cvsUsersCO, cvsFilesAdded," .
- " cvsFilesRemoved, cvsFilesModified, buildStatus) VALUES (".
+ " cvsFilesRemoved, cvsFilesModified, buildStatus, dejagnuPass," .
+ " dejagnuFail, dejagnuXFail, dejagnuXPass) VALUES (".
" \"$runDateTime\", \"$machineId\", \"$machineUname\"," .
" \"$gccVersion\", \"$cvsCpuTime\", \"$cvsWallTime\"," .
" \"$configureCpuTime\", \"$configureWallTime\", \"$buildCpuTime\"," .
" \"$buildWallTime\", \"$dejagnuCpuTime\", \"$dejagnuWallTime\"," .
" \"$warnings\", \"$warningsAdded\", \"$warningsRemoved\"," .
" \"$cvsUsersAdd\", \"$cvsUsersCO\", \"$cvsFilesAdded\"," .
- " \"$cvsFilesRemoved\", \"$cvsFilesModified\", \"$buildStatus\")";
+ " \"$cvsFilesRemoved\", \"$cvsFilesModified\", \"$buildStatus\"," .
+ " \"$dejagnuPASS\", \"$dejagnuFAIL\", \"$dejagnuXFAIL\"," .
+ " \"$dejagnuXPASS\")";
mysql_query($sqlQuery) or die(mysql_error());
$id = mysql_insert_id() or die(mysql_error());
return $id;
@@ -347,9 +351,10 @@
function acceptTestResults() {
//print "content-type: text/text\n\n";
+ global $print_debug;
// Database connection info
- $database = "llvmTestResults";
+ $database = "llvmNightlyTestResults";
$loginname = "llvm";
$password = "ll2002vm";
@@ -388,6 +393,24 @@
shutdown($mysql_link);
}
+$dejagnutests_log = $_POST['dejagnutests_log'];
+if (!isset($dejagnutests_log)) {
+ $dejagnutests_log = "";
+}
+
+$dejagnuPASS = matchOne("/\# of expected passes\s*([0-9]+)/", $dejagnutests_log, 0);
+$dejagnuFAIL = matchOne("/unexpected failures\s*([0-9]+)/", $dejagnutests_log, 0);
+$dejagnuXFAIL = matchOne("/\# of expected failures\s*([0-9]+)/", $dejagnutests_log, 0);
+$dejagnuXPASS = matchOne("/\# of unexpected passes\s*([0-9]+)/", $dejagnutests_log, 0);
+
+if ($print_debug) {
+ print "PASS: $dejagnuPASS\n";
+ print "FAIL: $dejagnuFAIL\n";
+ print "XFAIL: $dejagnuXFAIL\n";
+ print "XPASS: $dejagnuXPASS\n";
+}
+
+
//Extract addition test run information, bail out if missing starttime
if( !isset($_POST['starttime']) ) {
shutdown($mysql_link);
@@ -413,6 +436,18 @@
$warningsRemoved = $_POST['warnings_added'];
$buildstatus = $_POST['buildstatus'];
+if($buildstatus == "OK") {
+ $buildstatus = 1;
+}
+else if($buildstatus == "Error: compilation aborted") {
+ $buildstatus = 2;
+}
+else if($buildstatus == "Skipped by user") {
+ $buildstatus = 3;
+}
+else {
+ $buildstatus = 4;
+}
// Add new test run config
$testRunConfigId = addTestRunConfig($runDateTime, $machineId, $uname,
@@ -423,7 +458,8 @@
$dejagnuWallTime, $warnings, $warningsAdded,
$warningsRemoved, $cvsUsersAdd, $cvsUsersCO,
$cvsFilesAdded, $cvsFilesRemoved, $cvsFilesModified,
- $buildStatus);
+ $buildstatus, $dejagnuPASS, $dejagnuXPASS,
+ $dejagnuFAIL, $dejagnuXFAIL);
//Print data obtained so far
@@ -435,17 +471,17 @@
print "Nickname: $nickname\n";
print "\n";
- print "Test Run Config ID: $testRunConfigID\n";
- print "Start Time: $runDateTime\n";
+ print "Test Run Config ID: $testRunConfigId \n";
+ print "Start Time: $runDateTime \n";
print "Uname: $uname\n";
- print "GCC Version: $gccVersion\n";
- print "Cvs Cpu Time: $cvsCpuTime\n";
+ print "GCC Version: $gcc_version\n";
+ print "Cvs Cpu Time: $cvsCpuTime \n";
print "Cvs Wall Time: $cvsWallTime\n";
print "Configure Cpu Time: $configureCpuTime\n";
print "Configure Wall Time: $configureWallTime\n";
print "Build Cpu Time: $buildCpuTime\n";
print "Build Wall Time: $buildWallTime\n";
- print "Dejagnu Cpu Time: $dejagnuCupTime\n";
+ print "Dejagnu Cpu Time: $dejagnuCpuTime\n";
print "Dejagnu Wall Time: $dejagnuWallTime\n";
print "Warnings: $warnings\n";
print "Warnings Added: $warningsAdded\n";
@@ -455,7 +491,7 @@
print "Cvs Files Modified: $cvsFilesModified\n";
print "Cvs Users Commit: $cvsUsersAdd\n";
print "Cvs Users Checkout: $cvsUsersCO\n";
- print "Build Status: $buildStatus\n";
+ print "Build Status: $buildstatus\n";
}
Modified: nightly-test-server/trunk/NightlyTestAccept.php
URL: http://llvm.org/viewvc/llvm-project/nightly-test-server/trunk/NightlyTestAccept.php?rev=50030&r1=50029&r2=50030&view=diff
==============================================================================
--- nightly-test-server/trunk/NightlyTestAccept.php (original)
+++ nightly-test-server/trunk/NightlyTestAccept.php Mon Apr 21 00:02:41 2008
@@ -110,9 +110,13 @@
*
*******************************************************************************/
function WriteFile($filename, $contents) {
- $file = fopen($filename, "w") or die("Could not open file $filename for writing");
- fwrite($file, $contents) or die("Could not write to file $filename");
- fclose($file);
+
+ $file = fopen($filename, "w");
+
+ if($file) {
+ fwrite($file, $contents);
+ fclose($file);
+ }
}
/*******************************************************************************
@@ -159,8 +163,7 @@
function AddMachine($uname, $hardware, $os, $name, $nickname, $gcc_version, $directory) {
$query = "INSERT INTO machine (uname, hardware, os, name, nickname, gcc, directory) " .
"VALUES (\"$uname\",\"$hardware\",\"$os\",\"$name\",\"$nickname\",\"$gcc_version\",\"$directory\")";
- $insert_query = mysql_query($query) or die(mysql_error());
- mysql_free_result($insert_query);
+ mysql_query($query) or die(mysql_error());
}
/*******************************************************************************
@@ -274,8 +277,7 @@
"\"$newly_failing_tests\", \"$new_tests\", \"$removed_tests\", \"$cvs_added\"," .
"\"$cvs_removed\", \"$cvs_modified\", \"$cvs_usersadd\", \"$cvs_usersco\"" .
")";
- $insert_query = mysql_query($query) or die(mysql_error());
- mysql_free_result($insert_query);
+ mysql_query($query) or die(mysql_error());
$query = "SELECT id FROM night WHERE machine=$machine_id AND added=\"$added\"";
$machine_query = mysql_query($query) or die(mysql_error());
@@ -320,8 +322,7 @@
if (!StringIsNull($program)) {
$query = "INSERT INTO program (program, result, type, night) VALUES".
" (\"$program\", \"$result\", \"$type\", $night)";
- $program_query = mysql_query($query) or die(mysql_error());
- mysql_free_result($program_query);
+ mysql_query($query) or die(mysql_error());
}
}
@@ -343,8 +344,7 @@
if (!StringIsNull($program)) {
$query = "INSERT INTO tests (program, result, measure, night) VALUES".
" (\"$program\", \"$result\", \"$measure\", $night)";
- $program_query = mysql_query($query) or die(mysql_error());
- mysql_free_result($program_query);
+ mysql_query($query) or die(mysql_error());
}
}
@@ -366,8 +366,7 @@
function AddFile($file, $size, $night, $type) {
$query = "INSERT INTO file (file, size, night, type) VALUES".
" (\"$file\", \"$size\", \"$night\", \"$type\")";
- $file_query = mysql_query($query) or die(mysql_error());
- mysql_free_result($file_query);
+ mysql_query($query) or die(mysql_error());
}
/*******************************************************************************
@@ -467,6 +466,8 @@
*******************************************************************************/
function acceptTest() {
+ global $print_debug;
+
// If no nickname is set, die here
if (!isset($_POST['nickname'])) {
return;
@@ -677,7 +678,8 @@
$blank, $blank, $blank, // $expfail_tests, $TestsFixed, $TestsBroken,
$blank, $blank, // $TestsAdded, $TestsRemoved,
$cvsaddedfiles, $cvsremovedfiles, $cvsmodifiedfiles,
- $cvsusercommitlist, $cvsuserupdatelist);
+ $cvsusercommitlist, $cvsuserupdatelist,
+ $blank, $blank);
if ($print_debug) {
print "db_date: $db_date\n";
@@ -949,37 +951,47 @@
*
*******************************************************************************/
$cwd = getcwd();
-
- if (!file_exists('machines')) {
- mkdir('machines', 777);
- }
- chdir("$cwd/machines");
-
- if (!file_exists("$machine_id")) {
- mkdir("$machine_id", 777);
- }
- chdir("$cwd/machines/$machine_id");
-
- WriteFile("$db_date-Build-Log.txt", $build_log);
-
- $sentdata="";
- foreach ($_GET as $key => $value) {
- if(strpos($value, "\n") == 0) {
- $sentdata .= "'$key' => \"$value\",\n";
- } else {
- $sentdata .= "'$key' => <<EOD\n$value\nEOD\n,\n";
+
+ if($machine_id) {
+
+ if (!file_exists('machines')) {
+ mkdir('machines');
}
- }
- foreach ($_POST as $key => $value) {
- if(strpos($value, "\n") == 0) {
- $sentdata .= "'$key' => \"$value\",\n";
- } else {
- $sentdata .= "'$key' => <<EOD\n$value\nEOD\n,\n";
+
+ $machineDir = chdir("$cwd/machines");
+
+ if($machineDir) {
+ if (!file_exists("$machine_id")) {
+ mkdir("$machine_id");
+ }
+
+ $hasMachineDir = chdir("$cwd/machines/$machine_id");
+
+ if($hasMachineDir) {
+ WriteFile("$db_date-Build-Log.txt", $build_log);
+
+ $sentdata="";
+ foreach ($_GET as $key => $value) {
+ if(strpos($value, "\n") == 0) {
+ $sentdata .= "'$key' => \"$value\",\n";
+ } else {
+ $sentdata .= "'$key' => <<EOD\n$value\nEOD\n,\n";
+ }
+ }
+ foreach ($_POST as $key => $value) {
+ if(strpos($value, "\n") == 0) {
+ $sentdata .= "'$key' => \"$value\",\n";
+ } else {
+ $sentdata .= "'$key' => <<EOD\n$value\nEOD\n,\n";
+ }
+ }
+
+ WriteFile("$db_date-senddata.txt", $sentdata);
+ }
}
}
- WriteFile("$db_date-senddata.txt", $sentdata);
-
-
+
+
mysql_close($mysql_link);
}
More information about the llvm-commits
mailing list