? patch.txt Index: INSTALL.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletestauto/INSTALL.txt,v retrieving revision 1.5.4.1 diff -u -r1.5.4.1 INSTALL.txt --- INSTALL.txt 7 Jul 2007 08:47:53 -0000 1.5.4.1 +++ INSTALL.txt 18 Dec 2007 13:55:06 -0000 @@ -1,26 +1,19 @@ Simpletest automation installation instrucions Prerequisites: -- two drupal 5 sites, one is used -to get patches (simpletestauto block or new node) and then -sends them to other installation.The other one is used to receive -patches and put them in test queue and then run tests on each one -- a directory on the server that is writable by apache and accessible -by apache from the web. It can be secured to only be accessed from +1. Two drupal 5 sites are required. The first site (client) is a patch manager site. This is the site that humans interact with while uploading patches to be tested. The second site (server) is used to receive patches, put them in test queue, apply +the patches and run tests on the patched code. +2. A directory on the server that is writable by apache and accessible by apache from the web. It can be secured to only be accessed from localhost. -- database user that has permission that are needed by drupal and to -create and drop database +3. A database user that has the permissions that are needed by drupal to create and drop databases. -First server -1. install module (please use the latest version from cvs) and enable it -2. on settings page enter the testing server password, in -automatic server url write url of xmlrpc.php file on the other -installation -3. enable test your patch block +First site (client) +1. Download the simpletestauto project (please use the latest version from cvs) and enable the simpletestauto module. +2. On the settings page (admin/settings/simpletestauto) enter the testing server password. In the "automatic server url" field enter the URL of the xmlrpc.php file on the server site. +3. Enable the patch block -Second server -1. install module (please use the latest version from cvs) and enable it -2. on the settings page enter the same testing server password as on -the first server, enter xmlrpc.php address of the first server as Return address -3. look at simpletstauto_settings.php. There are some settings that need to be configured \ No newline at end of file +Second site (server) +1. Download the simpletestauto project and enabel the simpletestauto_server module module. +2. On the settings page (admin/settings/simpletestauto_server) enter the same testing server password as on the client site. Enter the xmlrpc.php address of the client site in the Return address. +3. Look at simpletstauto_settings.php. There are some settings that need to be configured. You must edit this file directly. Index: simpletestauto.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletestauto/simpletestauto.inc,v retrieving revision 1.3.2.7.2.4 diff -u -r1.3.2.7.2.4 simpletestauto.inc --- simpletestauto.inc 4 Oct 2007 18:24:29 -0000 1.3.2.7.2.4 +++ simpletestauto.inc 18 Dec 2007 13:55:06 -0000 @@ -6,23 +6,23 @@ $node->patch_url = file_create_url($file->filepath); } db_query("INSERT INTO {simpletestauto_test} (nid, project, patch_url, version, test_status, file_path, file_mime, file_size, issue_id, submitter) VALUES (%d, '%s', '%s', '%s', '%d', '%s', '%s', '%d', '%d', '%s')", $node->nid, $node->project, $node->patch_url,$node->version, $node->test_status, $file->filepath, $file->filemime, $file->filesize, $node->issue_id, $node->submitter); - - + + // // we send test to test server // $server_url = variable_get('simpletestauto_server_url', '$base_url/xmlrpc.php'); // $server_pwd = sha1(variable_get('simpletestauto_server_pwd', '')); // $msg = xmlrpc($server_url, 'simpletestautoServer.testPatch', $server_pwd, $node->nid); // if (stristr($msg,'Error')) { -// drupal_set_message(t($msg), 'error'); +// drupal_set_message(t($msg), 'error'); // } // else if ($msg) { // $new_url = url('node/'.$node->nid, NULL, NULL, TRUE); -// drupal_set_message(t('Your patch has been successfully submitted for testing, and will be tested the next time the automated tests run.')); +// drupal_set_message(t('Your patch has been successfully submitted for testing, and will be tested the next time the automated tests run.')); // } // else { // $err_no = xmlrpc_error_msg(); -// drupal_set_message(t('There was an error durring your request. Error: '.$err_no),'error'); -// } +// drupal_set_message(t('There was an error durring your request. Error: '.$err_no),'error'); +// } } function simpletestauto_test_update($node) { @@ -40,7 +40,7 @@ function simpletestauto_test_form(&$node) { global $drupal_releases; - + // after the test is tested editing is disabled if ($node->test_status != SIMPLETESTAUTO_NOT_TESTED) { $disabled = true; @@ -69,7 +69,7 @@ $form['project'] = array( '#type' => 'hidden', '#title' => t('Project name'), - '#description' => t('Which project is this patch for. If project is drupal core than write Drupal'), + '#description' => t('Which project is this patch for? If the project is drupal core than write %Drupal', array('%Drupal' => 'Drupal')), '#default_value' => 'Drupal', '#required' => TRUE, '#disabled' => $disabled, @@ -87,20 +87,20 @@ '#required' => TRUE, '#disabled' => $disabled, ); - + $form['patch_url'] = array( '#type' => 'textfield', '#title' => t('Patch URL'), '#default_value' => $node->patch_url, - '#description' => "Enter patch url here or upload patch.", - '#disabled' => $disabled, + '#description' => t("Enter patch URL here or upload patch in the field below."), + '#disabled' => $disabled, ); if (!isset($node->patch_url)) { - $form['patch_file'] = array( + $form['patch_file'] = array( '#type' => 'file', '#title' => t('File attachment'), '#size' => 40, - '#description' => ($node->patch_file || $node->patch_file ? t('A file already exists, if you upload another file the current file will be replaced.') : t('Attach a patch.')), + '#description' => ($node->patch_file || $node->patch_file ? t('A file already exists. If you upload another file the current file will be replaced.') : t('Attach a patch.')), ); } @@ -112,7 +112,7 @@ $edit = $_POST['edit']; $file = file_check_upload('patch_file'); if ($form_values['patch_url'] == "" && $file == NULL) { - form_set_error('patch_url', t('Please provide a patch url or upload a new file.')); + form_set_error('patch_url', t('Please provide a patch URL or upload a new file.')); } $form_values['file'] = file_save_upload($file); } @@ -128,7 +128,7 @@ function simpletestauto_test_view(&$node, $teaser = false, $page = false) { $node = node_prepare($node, $teaser); - + if (!$teaser && $page) { $rows = array(); @@ -156,7 +156,7 @@ break; case SIMPLETESTAUTO_IN_PROGRESS: $status = t('TESTING IN PROGRESS'); - break; + break; } $rows[] = array(t('Status: '), $status); $node->content['test_summary'] = array( @@ -178,11 +178,10 @@ return FALSE; } } - + if ($op == 'update' || $op == 'delete') { - if (user_access('edit own simpletestauto_test') && ($user->uid == $node->uid)) { - return TRUE; - } + if (user_access('edit own simpletestauto_test') && ($user->uid == $node->uid)) { + return TRUE; + } } } -?> Index: simpletestauto.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletestauto/simpletestauto.info,v retrieving revision 1.3.2.3 diff -u -r1.3.2.3 simpletestauto.info --- simpletestauto.info 7 Jul 2007 08:47:53 -0000 1.3.2.3 +++ simpletestauto.info 18 Dec 2007 13:55:06 -0000 @@ -1,4 +1,4 @@ -; $Id: simpletestauto.info,v 1.3.2.3 2007/07/07 08:47:53 rokZlender Exp $ +; $Id: simpletestauto.info,v 1.3.2.3 2007/07/07 08:47:53 rokZlender Exp $ name = Simpletest Automation -description = Allows automatical testing of submitted patches. -package = simpletest \ No newline at end of file +description = Allows automatic testing of submitted patches. +package = simpletest Index: simpletestauto.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletestauto/simpletestauto.install,v retrieving revision 1.6.2.1.2.4 diff -u -r1.6.2.1.2.4 simpletestauto.install --- simpletestauto.install 4 Oct 2007 18:14:07 -0000 1.6.2.1.2.4 +++ simpletestauto.install 18 Dec 2007 13:55:06 -0000 @@ -3,7 +3,7 @@ /* * Created on 3.6.2006 */ - + function simpletestauto_install() { switch ($GLOBALS['db_type']) { case 'mysql': @@ -12,9 +12,9 @@ nid int(10) unsigned NOT NULL default '0', project varchar(50) NOT NULL default '', patch_url varchar(255) NOT NULL default '', - version varchar(50) NOT NULL default '', + version varchar(50) NOT NULL default '', test_status int(1) NOT NULL default '0', - file_path varchar(255) NOT NULL default '', + file_path varchar(255) NOT NULL default '', file_mime varchar(255) NOT NULL default '', file_size int NOT NULL default '0', issue_id int NOT NULL default '0', @@ -24,13 +24,13 @@ ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;"); break; - + case 'pgsql': db_query("CREATE TABLE {simpletestauto_test} ( nid int NOT NULL default '0', project varchar(50) NOT NULL default '', patch_url varchar(255) NOT NULL default '', - version varchar(50) NOT NULL default '', + version varchar(50) NOT NULL default '', test_status int NOT NULL default '0', file_path varchar(255) NOT NULL default '', file_mime varchar(255) NOT NULL default '', @@ -41,7 +41,8 @@ PRIMARY KEY (nid)"); break; } -} +} + function simpletestauto_update_1() { $items = array(); $items[] = update_sql("ALTER TABLE {simpletestauto_test} ADD issue_id int NOT NULL default '0'"); @@ -49,5 +50,3 @@ $items[] = update_sql("ALTER TABLE {simpletestauto_test} ADD submitter varchar(100) NOT NULL default ''"); return $items; } - -?> Index: simpletestauto.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletestauto/simpletestauto.module,v retrieving revision 1.26.2.16.2.4 diff -u -r1.26.2.16.2.4 simpletestauto.module --- simpletestauto.module 5 Oct 2007 14:58:50 -0000 1.26.2.16.2.4 +++ simpletestauto.module 18 Dec 2007 13:55:06 -0000 @@ -8,15 +8,15 @@ if (file_exists("$path/simpletestauto.inc")) { require_once "$path/simpletestauto.inc"; } - + define('SIMPLETESTAUTO_NOT_TESTED', 0); define('SIMPLETESTAUTO_IN_PROGRESS', 1); define('SIMPLETESTAUTO_FINISHED', 2); define('SIMPLETESTAUTO_PASS', 3); define('SIMPLETESTAUTO_FAIL', 4); define('SIMPLETESTAUTO_SUBMITED', 5); - - + + /** * Display help and module information * @param section which section of the site we're displaying help @@ -24,22 +24,22 @@ */ function simpletestauto_help($section='') { $output = ""; - + switch($section) { case "admin/modules#description"; $output = t("Simpletest automation"); break; case 'node/add#simpletestauto_test': - $output = t('Submit your patch into automatic testing system.'); + $output = t('Submit your patch into the automatic testing system.'); break; } - + return $output; } /** * Valid permission for this module - * + * */ function simpletestauto_perm() { return array('Access test automation', 'Administer test automation', 'create simpletestauto_test', 'edit own simpletestauto_test'); @@ -51,14 +51,14 @@ function simpletestauto_menu($may_cache) { $items[] = array( 'path' => 'admin/settings/simpletestauto', - 'title' => t('Simpletestauto Settings'), - 'description' => t('Simpletestauto settings page. Test server information, somet test settings, ...'), + 'title' => t('Simpletestauto settings'), + 'description' => t('Simpletestauto settings page.'), 'callback' => 'drupal_get_form', 'callback arguments' => array('simpletestauto_admin_settings'), 'access' => user_access('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); - + return $items; } @@ -72,18 +72,18 @@ '#title' => t('Automatic testing server password'), '#default_value' => variable_get('simpletestauto_server_pwd', ''), '#size' => 50, - '#description' => t('Testing server password.'), + '#description' => t('A password of your choice. Does not correspond to any Drupal user account. You will need to enter this password on the server site as well.'), ); - + $form['simpletestauto_server_url'] = array( '#type' => 'textfield', - '#title' => t('Automatic testing server url'), + '#title' => t('Automatic testing server URL'), '#default_value' => variable_get('simpletestauto_server_url', $base_url.'/xmlrpc.php'), '#size' => 50, '#maxlength' => 255, - '#description' => t('Url of the server that will handle request for automatic patch testing.'), + '#description' => t('URL of the server that will handle request for automatic patch testing.'), ); - + return system_settings_form($form); } @@ -99,16 +99,16 @@ $server_pwd = sha1(isset($form_values['simpletestauto_server_pwd']) ? $form_values['simpletestauto_server_pwd'] : variable_get('simpletestauto_server_pwd', '')); $msg = xmlrpc($server_url, 'simpletestautoServer.ping', $server_pwd); if ($msg == FALSE) { - form_set_error('simpletestauto_server_url', t('Please check test server url and that test server is online and simpletestauto module is enabled')); + form_set_error('simpletestauto_server_url', t('Please check the test server URL and that the test server is online with the simpletestauto_server module enabled.')); } else { if (stristr($msg,'Error')) { - if (stristr($msg,'password')) { - form_set_error('simpletestauto_server_pwd', t($msg)); + if (stristr($msg,'password')) { + form_set_error('simpletestauto_server_pwd', t($msg)); + } + else { + form_set_error('simpletestauto_server_url', t($msg)); } - else { - form_set_error('simpletestauto_server_url', t($msg)); - } } } } @@ -121,10 +121,10 @@ */ function simpletestauto_form_alter($form_id, &$form) { if($_POST['edit']['form_id'] == "simpletestauto_admin_settings") { - $edit = $_POST['edit']; - if ($edit['simpletestauto_server_pwd']['pass1'] == $edit['simpletestauto_server_pwd']['pass2'] && $edit['simpletestauto_server_pwd']['pass1'] == "") { - unset($form['simpletestauto_server_pwd']); - } + $edit = $_POST['edit']; + if ($edit['simpletestauto_server_pwd']['pass1'] == $edit['simpletestauto_server_pwd']['pass2'] && $edit['simpletestauto_server_pwd']['pass1'] == "") { + unset($form['simpletestauto_server_pwd']); + } } } @@ -132,16 +132,16 @@ // Only if this server is used to catch patches we define new node type. return array( 'simpletestauto_test' => array( - 'name' => t('test instance'), + 'name' => t('test instance'), 'module' => 'simpletestauto_test', - 'description' => t('Test instance node. Create a test instance and send your patch into automatic testing process.'), + 'description' => t('A node representing a test instance. Create a test instance and send your patch into automatic the testing process.'), ), ); -} +} /** * Implementation of hook_xmlrpc - * Used on testserver side to receive + * Used by server site to receive patches */ function simpletestauto_xmlrpc() { $handlers = array(); @@ -152,8 +152,8 @@ } /** - * XML-rpc handler used on testserver side. - * It receives request to test a patch creates a node and returns this node id back to project server. + * XML-rpc handler used on server site. + * It receives requests to test patches and creates a node for each. The newly created node id is returned back to client site. * And it runs a script that will run the tests. */ function simpletestauto_writeResult($password, $nid, $result, $status, $site_url) { @@ -174,17 +174,17 @@ node_save($node); $result = $status ? 'failed' : 'passed'; - + $short_msg = "DrupalCHKbot tested " . $node->submitter ."'s patch, the patch $result. For more information visit " . url('node/' . $node->nid, NULL, NULL, TRUE); - + exec("/home/self/tinderbox/action/post_followup.php scriptdir=/home/self/tinderbox/ path=http://drupal.org/node/$node->issue_id entry=$short_msg", $output, $return); - + watchdog('simpletestauto', $short_msg); - + return TRUE; } else { - return xmlrpc_error(2, t("Error: Wrong simpletestauto server password please check your settings")); + return xmlrpc_error(2, t("Error: Wrong simpletestauto server password please check your settings")); } } @@ -203,24 +203,24 @@ $xmlrpcval['version'] = $node->version; $xmlrpcval['patch_url'] = $node->patch_url; $node->test_status = SIMPLETESTAUTO_IN_PROGRESS; - $node->body .= "
" . format_date(time(), 'large')."
Testing in progress."; + $node->body .= "
" . format_date(time(), 'large'). "
". t('Testing in progress.'); node_save($node); return $xmlrpcval; } else { - return xmlrpc_error(2, t("Error: Wrong simpletestauto server password please check your settings")); - } + return xmlrpc_error(2, t("Error: Wrong simpletestauto server password please check your settings")); + } } /** * Implementation of hook_block - * Displays test block on project server used for manual patch testing. + * Displays test block on client site used for manual patch testing. */ function simpletestauto_block($op='list', $delta=0) { $r = 0; if (variable_get('simpletestauto_catch_patch',0)) { if ($op == 'list') { - $block[0]["info"] = t("Test your patch"); + $block[0]["info"] = t("Test your patch"); return $block; } else if ($op == 'view') { @@ -269,14 +269,14 @@ /** * Function that handles form submit from simpletestauto block. - * It sends request to test server and displays drupal message. + * It sends a request to the server site and displays a drupal message. */ function patch_test_block_submit($form_id, $form_values) { global $base_url, $user; $server_url = variable_get('simpletestauto_server_url', '$base_url/xmlrpc.php'); $server_pwd = sha1(variable_get('simpletestauto_server_pwd', '')); $node = new stdClass(); - $node->teaser = $node->body; + $node->teaser = $node->body; $node->log = ""; $node->type = "simpletestauto_test"; $node->status = "1"; @@ -288,7 +288,7 @@ $patchfile = explode('/', $node->patch_url); $patchfile = $patchfile[count($patchfile)-1]; $node->title = "Testing $patchfile for $node->project"; - $node->body = format_date(time(), 'large')."
Test is in test queue."; + $node->body = format_date(time(), 'large')."
". t('Test is in the test queue.'); $node->nodeapi = 0; node_save($node); $new_url = url('node/'.$node->nid, NULL, NULL, TRUE); @@ -296,8 +296,7 @@ } /** - * Function handles new incoming patches - * + * Handle new incoming patches */ function simpletestauto_newPatch($issue, $patch, $title, $etc) { $p_user = user_load(array('uid'=>1)); @@ -312,9 +311,8 @@ watchdog('simpletest_auto', $etc['node']); $node->test_status = SIMPLETESTAUTO_NOT_TESTED; $node->title = "Testing $patch for $title"; - $node->body = format_date(time(), 'large')."
Test is in test queue."; + $node->body = format_date(time(), 'large')."
". t('Test is in the test queue.'); $node->nodeapi = 0; node_save($node); return $node->nid; } - Index: simpletestauto_server.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletestauto/Attic/simpletestauto_server.module,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 simpletestauto_server.module --- simpletestauto_server.module 8 Jul 2007 09:07:39 -0000 1.1.2.2 +++ simpletestauto_server.module 18 Dec 2007 13:55:07 -0000 @@ -6,13 +6,13 @@ */ function simpletestauto_server_help($section='') { $output = ""; - + switch($section) { case "admin/modules#description"; $output = t("Simpletest automation test server"); break; } - + return $output; } @@ -23,13 +23,13 @@ $items[] = array( 'path' => 'admin/settings/simpletestauto_server', 'title' => t('Simpletestauto test server settings'), - 'description' => t('Simpletestauto test server settings page. Test server information, return address, ...'), + 'description' => t('Simpletestauto test server settings page.'), 'callback' => 'drupal_get_form', 'callback arguments' => array('simpletestauto_server_admin_settings'), 'access' => user_access('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); - + return $items; } @@ -43,18 +43,19 @@ '#title' => t('Automatic testing server password'), '#default_value' => variable_get('simpletestauto_server_pwd', ''), '#size' => 50, - '#description' => t('Testing server password.'), + '#description' => t('Testing server password. This is the same password as you enter on the client site. It is a password of your choice.'), ); $form['simpletestauto_return_address'] = array( '#type' => 'textfield', '#title' => t('Patch server address'), + // TODO: Is Address here really an XML-rpc endpoint? '#description' => t('Address from which test data will be collected and where to send results'), '#default_value' => variable_get('simpletestauto_return_address', ''), ); - - - - + + + + return system_settings_form($form); } @@ -64,68 +65,68 @@ */ function simpletestauto_server_form_alter($form_id, &$form) { if($_POST['edit']['form_id'] == "simpletestauto_server_admin_settings") { - $edit = $_POST['edit']; - if ($edit['simpletestauto_server_pwd']['pass1'] == $edit['simpletestauto_server_pwd']['pass2'] && $edit['simpletestauto_server_pwd']['pass1'] == "") { - unset($form['simpletestauto_server_pwd']); - } + $edit = $_POST['edit']; + if ($edit['simpletestauto_server_pwd']['pass1'] == $edit['simpletestauto_server_pwd']['pass2'] && $edit['simpletestauto_server_pwd']['pass1'] == "") { + unset($form['simpletestauto_server_pwd']); + } } } /** * Implementation of hook_cron - * used to delete old tests only on testing server + * Used to delete old tests from the testing server */ function simpletestauto_server_cron() { global $base_url; $path = drupal_get_path('module', 'simpletestauto'); if (file_exists("$path/simpletestauto_settings.php")) { - require_once "$path/simpletestauto_settings.php"; + require_once "$path/simpletestauto_settings.php"; } $test_dir = $simpletest_install_dir; $dirs = file_scan_directory($test_dir, '\clean$'); $removed_strings = array($test_dir, 'clean'); foreach($dirs as $instance_dir) { $dir = $instance_dir->filename; - $instance = trim(str_replace($removed_strings,'',$dir),'/'); - $exec_cmd = $bins['mysqladmin'] . " -f -u $db_user -p$db_pass drop $instance"; - exec($exec_cmd, $output, $status); - $exec_cmd = "rm -rf $test_dir/$instance"; - exec($exec_cmd, $output, $status); + $instance = trim(str_replace($removed_strings,'',$dir),'/'); + $exec_cmd = $bins['mysqladmin'] . " -f -u $db_user -p$db_pass drop $instance"; + exec($exec_cmd, $output, $status); + $exec_cmd = "rm -rf $test_dir/$instance"; + exec($exec_cmd, $output, $status); } } /** * Implementation of hook_xmlrpc - * Used on testserver side to receive + * Used on server side to receive incoming patches. */ function simpletestauto_server_xmlrpc() { - $handlers = array(); + $handlers = array(); $handlers['simpletestautoServer.testPatch'] = 'simpletestauto_server_testPatch'; - $handlers['simpletestautoServer.ping'] = 'simpletestauto_server_ping'; - return $handlers; + $handlers['simpletestautoServer.ping'] = 'simpletestauto_server_ping'; + return $handlers; } /** - * XML-rpc handler used on testserver side. - * It receives request to test a patch creates a node and returns this node id back to project server. - * And it runs a script that will run the tests. + * XML-rpc handler used on server side. + * It receives request to test a patch creates a node and returns this node id back to the client site. + * It then runs a script that will execute the Simpletest tests. */ function simpletestauto_server_testPatch($password, $nid) { global $base_url; $path = drupal_get_path('module', 'simpletestauto'); if (file_exists("$path/simpletestauto_settings.php")) { - require_once "$path/simpletestauto_settings.php"; + require_once "$path/simpletestauto_settings.php"; } if ( $password == sha1(variable_get('simpletestauto_server_pwd', ''))) { $test_it_path = drupal_get_path('module', 'simpletestauto_server'); - $current_tests = variable_get('simpletestauto_tests', array()); - array_push($current_tests, $nid); - variable_set('simpletestauto_tests', $current_tests); - exec($bins['phpExec'] . " $test_it_path/test_it.php > /dev/null &"); - return TRUE; - } + $current_tests = variable_get('simpletestauto_tests', array()); + array_push($current_tests, $nid); + variable_set('simpletestauto_tests', $current_tests); + exec($bins['phpExec'] . " $test_it_path/test_it.php > /dev/null &"); + return TRUE; + } else { - return "Error: Wrong simpletestauto server password please check your settings"; + return t("Error: Wrong simpletestauto server password please check your settings"); } } @@ -137,6 +138,6 @@ return "OK"; } else { - return "Error: Wrong simpletestauto server password please check your settings"; + return t("Error: Wrong simpletestauto server password please check your settings"); } -} \ No newline at end of file +} Index: test_it.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletestauto/test_it.php,v retrieving revision 1.20.2.11.2.4 diff -u -r1.20.2.11.2.4 test_it.php --- test_it.php 4 Oct 2007 21:54:48 -0000 1.20.2.11.2.4 +++ test_it.php 18 Dec 2007 13:55:07 -0000 @@ -13,7 +13,7 @@ include_once './includes/bootstrap.inc'; } else { - exit("bootstrap.inc could not be loaded\n"); + exit("bootstrap.inc could not be loaded\n"); } } @@ -23,7 +23,7 @@ */ function test($node_id) { global $simpletest_install_dir, $simpletest_modules, $bins, $msg, $executed_commands, $install_url; - + // we get all the data we need through a xmlrpc call to main server where data is held $node = xmlrpc(variable_get('simpletestauto_return_address', ''), 'simpletestauto_getTestData', sha1(variable_get('simpletestauto_server_pwd', '')), $node_id); @@ -54,8 +54,8 @@ //Check out needed modules foreach($simpletest_modules as $module) { - $module_tag = get_latest_tag($module, $version); - if (!$module_tag) return terminateTesting(1, "Could not get tag for module $module core version " . $version['core']); + $module_tag = get_latest_tag($module, $version); + if (!$module_tag) return terminateTesting(1, "Could not get tag for module $module core version " . $version['core']); $exec_cmd = $bins['cvs'] . ' -z6 -Q -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib co -d sites/all/modules/'.$module.' -r ' . $module_tag . ' contributions/modules/' . $module; if (!execute($exec_cmd, "Unable to check $module module branch " . $version['maj'] . " out of CVS.")) return FALSE; } @@ -63,8 +63,8 @@ //applying patch $exec_cmd = $bins['wget'] . ' -q -O - '.$patch_url.' | ' . $bins['patch'] . ' -p0 -d ' . $instance_dir; if (!execute($exec_cmd, "Unable to patch file.")) return FALSE; - - if (!checkSyntax($patch_url)) return FALSE; + + if (!checkSyntax($patch_url)) return FALSE; return terminateTesting(0, $msg); } @@ -72,7 +72,7 @@ /** * Function that sends response to test server and calls exit * @param exit_status arguemnt for exit call - * @param msg message string for sending to test server + * @param msg message string for sending to test server */ function terminateTesting($exit_status, $terminate_msg) { global $drupal_dir, $node_id, $executed_commands, $debug, $test_it_path, $msg, $install_url; @@ -82,7 +82,7 @@ if ($debug) { $commands = implode("
", $executed_commands); $msg = "
Executed commands:
" . $commands . "
" . $msg ; - } + } $msg = xmlrpc(variable_get('simpletestauto_return_address', ''), 'simpletestauto.writeResult', sha1(variable_get('simpletestauto_server_pwd', '')), $node_id, $msg, $exit_status, $install_url); if ($exit_status == 1) { return FALSE; @@ -101,9 +101,9 @@ function check_bins($bins) { $not_found = array(); foreach ($bins as $key => $value) { - if (!file_exists($value)) { - $not_found[] = $value; - } + if (!file_exists($value)) { + $not_found[] = $value; + } } if (count($not_found) != 0) { exit("Following binaries were not found in their paths: " . implode(",",$not_found) . "\n"); @@ -154,7 +154,7 @@ /** * Checks http://updates.drupal.org/release-history/ of specific module and gets latest * stable or unstable if stable does not exists for specific core version - * + * * @param $module module name which we want to checkout * @version $version version of core we are after * @return cvs tag ready for checkout @@ -189,7 +189,7 @@ /** * Checky syntax of files that are patched with patch at patch_url. - * Syntax is checked with php -l + * Syntax is checked with php -l * * @param $patch_url patch url from which files that need checking are read */ @@ -215,7 +215,7 @@ } } if (!$test_status) { - return terminateTesting(1, '
Syntax error:
' . $msg . '
'); + return terminateTesting(1, '
Syntax error:
' . $msg . '
'); } return $test_status; }