Index: review/simpletest/pifr_simpletest.server.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/review/simpletest/pifr_simpletest.server.inc,v
retrieving revision 1.12
diff -u -r1.12 pifr_simpletest.server.inc
--- review/simpletest/pifr_simpletest.server.inc	16 Dec 2009 23:08:27 -0000	1.12
+++ review/simpletest/pifr_simpletest.server.inc	18 Dec 2009 23:56:18 -0000
@@ -32,7 +32,7 @@
       'title' => 'test run failure',
       'active title' => 'detect a test run failure',
       'description' => 'Ensure that you can install SimpleTest locally and invoke tests using the command line script.',
-      'summary' => 'Failed to run tests on @environment: @reason.',
+      'summary' => 'Failed to run tests: @reason',
       'confirmation' => 'pifr_simpletest',
     ));
     $this->steps['fail'] = array_merge($this->steps['fail'], array(
Index: server/pifr_server.api.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.api.inc,v
retrieving revision 1.3
diff -u -r1.3 pifr_server.api.inc
--- server/pifr_server.api.inc	4 Dec 2009 20:29:08 -0000	1.3
+++ server/pifr_server.api.inc	18 Dec 2009 23:56:18 -0000
@@ -16,8 +16,7 @@
 function hook_pifr_server_result($test, $result) {
   // Ensure that testing is complete.
   if ($test['status'] == PIFR_SERVER_TEST_STATUS_RESULT) {
-    // Get the result that matters.
-    $result = pifr_server_result_summary_result($test['test_id']);
+    // Do something.
   }
 }
 
@@ -31,7 +30,6 @@
 function hook_pifr_server_client_result($test, $result, $client) {
   // Ensure that testing is complete.
   if ($test['status'] == PIFR_SERVER_TEST_STATUS_RESULT) {
-    // Get the result that matters.
-    $result = pifr_server_result_summary_result($test['test_id']);
+    // Do something.
   }
 }
Index: server/pifr_server.xmlrpc.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.xmlrpc.inc,v
retrieving revision 1.37
diff -u -r1.37 pifr_server.xmlrpc.inc
--- server/pifr_server.xmlrpc.inc	17 Dec 2009 20:47:07 -0000	1.37
+++ server/pifr_server.xmlrpc.inc	18 Dec 2009 23:56:18 -0000
@@ -90,7 +90,7 @@
 
     // Postpone tests if branch is currently failing.
     foreach ($branches as $branch) {
-      if (pifr_server_result_summary_result($branch['test_id'])) {
+      if (!pifr_server_result_summary_status($branch['test_id'])) {
         // Postpone all tests that have been queued.
         pifr_server_file_branch_update($branch['branch_id'], PIFR_SERVER_TEST_STATUS_QUEUED, PIFR_SERVER_TEST_STATUS_POSTPONED);
       }
@@ -405,13 +405,10 @@
         break;
       }
 
-      // Get the result if any that summarizes the test (aka failed).
-      $result = pifr_server_result_summary_result($test['test_id']);
-
       $batch['results'][] = array(
         'test_id' => $test['test_id'],
-        'pass' => !$result,
-        'message' => pifr_server_result_summary_message($result),
+        'pass' => pifr_server_result_summary_status($test['test_id']),
+        'message' => pifr_server_result_summary_message($test['test_id']),
       );
       pifr_server_log($test['test_id'], $client['client_id'], PIFR_SERVER_LOG_CLIENT_RETRIEVE);
       $count++;
Index: server/pifr_server.event.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.event.inc,v
retrieving revision 1.15
diff -u -r1.15 pifr_server.event.inc
--- server/pifr_server.event.inc	4 Dec 2009 20:29:07 -0000	1.15
+++ server/pifr_server.event.inc	18 Dec 2009 23:56:18 -0000
@@ -52,8 +52,7 @@
 
   if (!empty($params['test'])) {
     $test = $params['test'];
-    $result_summary = pifr_server_result_summary_result($test['test_id']);
-    $pass = $result_summary ? pifr_server_review_check($result_summary) : TRUE;
+    $pass = pifr_server_result_summary_status($test['test_id']);
 
     // Generate a summary of the details for each result.
     $results = pifr_server_result_get_all($test['test_id']);
@@ -76,7 +75,7 @@
       '%last_tested' => format_date($test['last_tested']),
       '%test_count' => number_format($test['test_count']),
       '%result_word' => t($pass ? 'passed' : 'failed', array()),
-      '%result_summary' => pifr_server_result_summary_message($result_summary),
+      '%result_summary' => pifr_server_result_summary_message($test['test_id']),
       '%result_detail_summary' => implode("\n\n", $detail_summaries),
     );
   }
@@ -137,7 +136,7 @@
   }
 
   if ($context['result'] != 'any') {
-    $result = pifr_server_result_summary_result($test['test_id']) ? 'fail' : 'pass';
+    $result = pifr_server_result_summary_status($test['test_id']) ? 'fail' : 'pass';
     if ($context['result'] != $result) {
       return;
     }
Index: server/pifr_server.test.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.test.inc,v
retrieving revision 1.62
diff -u -r1.62 pifr_server.test.inc
--- server/pifr_server.test.inc	17 Dec 2009 20:47:07 -0000	1.62
+++ server/pifr_server.test.inc	18 Dec 2009 23:56:18 -0000
@@ -286,13 +286,37 @@
   // Determine the environment ID that the client is supposed to be testing.
   $result['environment_id'] = pifr_server_environment_status_get_client($test, $client);
 
-  // Update test record to reflect the fact that a result has been returned.
-  if (count($results) + 1 == count($environments) || !pifr_server_review_check($result)) {
-    $test['status'] = PIFR_SERVER_TEST_STATUS_RESULT;
-  }
-  else {
-    $test['status'] = PIFR_SERVER_TEST_STATUS_QUEUED;
+  // If test is currently marked as queued then evaluate the result to
+  // determine what the status of the tests should be set to.
+  if ($test['status'] == PIFR_SERVER_TEST_STATUS_QUEUED) {
+    // If this result constitutes the final result (all environments reviewed)
+    // then mark the test as complete.
+    if (count($results) + 1 == count($environments)) {
+      $test['status'] = PIFR_SERVER_TEST_STATUS_RESULT;
+    }
+    elseif (!pifr_server_review_check($result)) {
+      // Get a list of all the plugins being used by the environments.
+      $plugins = pifr_server_environment_plugins($test);
+
+      // Cycle through each already recorded result and remove the plugin
+      // associated with it if the result represents a failure.
+      foreach ($results as $previous_result) {
+        if (!pifr_server_review_check($previous_result)) {
+          unset($plugins[$environments[$previous_result['environment_id']]['plugin']]);
+        }
+      }
+      unset($plugins[$environments[$result['environment_id']]['plugin']]);
+
+      // At least one environment from each plugin has failed.
+      if (!$plugins) {
+        $test['status'] = PIFR_SERVER_TEST_STATUS_RESULT;
+      }
+    }
+
+    // Otherwise the result is a pass and not the finally result so allow
+    // testing to continue.
   }
+
   $test['last_tested'] = time();
   $test['test_count']++;
   pifr_server_test_save($test);
@@ -499,15 +523,14 @@
  * @param array $test Test information.
  */
 function pifr_server_test_view_result(array &$form, array $test) {
-  // Get the result if any that summarizes the test (aka failed).
-  $summary_result = pifr_server_result_summary_result($test['test_id']);
+  $pass = pifr_server_result_summary_status($test['test_id']);
 
   $form['summary'] = array(
     '#type' => 'fieldset',
     '#title' => t('Summary'),
-    '#attributes' => array('id' => 'pifr-result-summary', 'class' => ($summary_result ? 'pifr-error' : 'pifr-ok')),
+    '#attributes' => array('id' => 'pifr-result-summary', 'class' => ($pass ? 'pifr-ok' : 'pifr-error')),
     '#weight' => -6,
-    '#value' => '<span id="pifr-result-summary-message">' . pifr_server_result_summary_message($summary_result) . '</span>',
+    '#value' => '<span id="pifr-result-summary-message">' . pifr_server_result_summary_message($test['test_id']) . '</span>',
   );
 
   $form['detail'] = array(
@@ -535,10 +558,6 @@
     if (!empty($results[$environment['environment_id']])) {
       $result = $results[$environment['environment_id']];
 
-      if ($result['result_id'] == $summary_result['result_id']) {
-        $form['detail']['environment'][$environment['environment_id']]['#selected'] = TRUE;
-      }
-
       // Add the review log in a fieldset at the end of the results.
       $review_log = array(
         '#type' => 'fieldset',
Index: server/pifr_server.result.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.result.inc,v
retrieving revision 1.22
diff -u -r1.22 pifr_server.result.inc
--- server/pifr_server.result.inc	4 Dec 2009 20:29:07 -0000	1.22
+++ server/pifr_server.result.inc	18 Dec 2009 23:56:18 -0000
@@ -77,47 +77,52 @@
 }
 
 /**
- * Determine the result if any that summarizes the test.
- *
- * Cycle through the results and finds the result that did not pass and thus
- * provides a summary of the review result.
+ * Determine if a test passed or failed.
  *
  * @param integer $test_id Test ID.
- * @return array Result information, or FALSE.
- * @see pifr_server_result_get()
+ * @return boolean TRUE is pass, otherwise FALSE.
  */
-function pifr_server_result_summary_result($test_id) {
+function pifr_server_result_summary_status($test_id) {
+  $pass = TRUE;
   $results = pifr_server_result_get_all($test_id);
-  foreach ($results as $environment_id => $result) {
-    if (!pifr_server_review_check($result)) {
-      return $result;
-    }
+  foreach ($results as $result) {
+    $pass = $pass && pifr_server_review_check($result);
   }
-  return FALSE;
+  return $pass;
 }
 
 /**
- * Generate a summary message based on the summary result.
- *
- * The summary result can be determined by pifr_server_result_summary_result().
+ * Generate a summary message for a test.
  *
- * @param array $result Result information.
- * @return string Translated summary message.
+ * @param integer $test_id Test ID.
+ * @return string Summary message.
  */
-function pifr_server_result_summary_message($result) {
-  if ($result) {
+function pifr_server_result_summary_message($test_id) {
+  // Cycle through all results and create a two level array structure with the
+  // summary of each environment grouped by plugin.
+  $summary = array();
+  $pass = TRUE;
+  $results = pifr_server_result_get_all($test_id);
+  $environments = pifr_server_environment_get_all_test($test_id);
+  foreach ($results as $result) {
+    $pass = $pass && pifr_server_review_check($result);
+
     $summary = pifr_server_review_summary($result);
     $details = pifr_server_review_summary_format($result);
 
-    $environment = pifr_server_environment_get($result['environment_id']);
-    $details['@environment'] = $environment['title'];
+    $environment = $environments[$result['environment_id']];
+    $summary[$environment['plugin']][] = '[' . $environment['title'] . '] ' . t($summary, $details);
   }
-  else {
-    $summary = 'Passed on all environments.';
-    $details = array();
+
+  // Condense the two level array into a summary string.
+  $plugin_info = pifr_server_review_get_all();
+  foreach ($summary as $plugin => $parts) {
+    $summary[$plugin] = '[[' . $plugin_info[$plugin] . ']]: ' . implode(', ', $parts);
   }
+  $summary = implode('; ', $summary) . '.';
 
-  return t($summary, $details);
+  // Prepend overall summary status to summary.
+  return ($pass ? t('PASSED') : t('FAILED')) . ': ' . $summary;
 }
 
 /**
Index: server/pifr_server.environment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.environment.inc,v
retrieving revision 1.14
diff -u -r1.14 pifr_server.environment.inc
--- server/pifr_server.environment.inc	18 Dec 2009 22:27:57 -0000	1.14
+++ server/pifr_server.environment.inc	18 Dec 2009 23:56:18 -0000
@@ -499,6 +499,21 @@
 }
 
 /**
+ * Get a list of all the plugins being used by the environments of the test.
+ *
+ * @param array $test Test information.
+ * @return array Associative array of plugins.
+ */
+function pifr_server_environment_plugins(array $test) {
+  $environments = pifr_server_environment_get_all_test($test['test_id']);
+  $plugins = array();
+  foreach ($environments as $environment) {
+    $plugins[$environment['plugin']] = $environment['plugin'];
+  }
+  return $plugins;
+}
+
+/**
  * Reserve an environment for a particular test and client.
  *
  * @param integer $environment_id Environment ID.
Index: review/server.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/review/server.inc,v
retrieving revision 1.16
diff -u -r1.16 server.inc
--- review/server.inc	17 Dec 2009 01:44:47 -0000	1.16
+++ review/server.inc	18 Dec 2009 23:56:18 -0000
@@ -60,7 +60,7 @@
       'active title' => 'setup environment',
       'description' => 'The client is most likely malfunctioning.',
       'help' => 'The client failed to setup the testing environment. Check the pifr_client the !install.',
-      'summary' => 'Setup environment: @reason.',
+      'summary' => 'Setup environment: @reason',
       'confirmation' => FALSE,
     ),
     'fetch' => array(
@@ -68,7 +68,7 @@
       'active title' => 'detect an invalid file URL',
       'description' => 'Ensure the file server is functioning properly.',
       'help' => 'The client failed to detect an invalid file URL that pointed to example.com.',
-      'summary' => 'Fetch test file: @reason.',
+      'summary' => 'Fetch test file: @reason',
       'confirmation' => 'no-patch',
     ),
     'checkout' => array(
@@ -76,7 +76,7 @@
       'active title' => 'detect invalid repository information',
       'description' => 'Ensure the version control system is functioning properly.',
       'help' => 'The client failed to detect invalid repository information that pointed to example.com.',
-      'summary' => 'Repository checkout: @reason.',
+      'summary' => 'Repository checkout: @reason',
       'confirmation' => 'no-patch',
     ),
     'check' => array(
@@ -84,7 +84,7 @@
       'active title' => 'detect invalid patch format',
       'description' => 'Ensure the patch only contains unix-style line endings.',
       'help' => 'The client failed to @type which is induced using the !patch.',
-      'summary' => 'Invalid patch format in @filename.',
+      'summary' => 'Invalid patch format in @filename',
       'confirmation' => 'pifr_server',
     ),
     'apply' => array(
@@ -92,7 +92,7 @@
       'active title' => 'detect a non-applicable patch',
       'description' => 'Ensure the patch applies to the lastest checkotu of the code-base.',
       'help' => 'The client failed to @type which is induced using the !patch.',
-      'summary' => 'Unable to apply patch @filename.',
+      'summary' => 'Unable to apply patch @filename',
       'confirmation' => 'pifr_server',
     ),
     'syntax' => array(
@@ -100,7 +100,7 @@
       'active title' => 'detect invalid syntax',
       'description' => 'Check the syntax of the files.',
       'help' => 'The client failed to @type which is induced using the !patch.',
-      'summary' => 'Invalid syntax in @filename.',
+      'summary' => 'Invalid syntax in @filename',
       'confirmation' => FALSE,
     ),
     'install' => array(
@@ -108,7 +108,7 @@
       'active title' => 'detect an installation failure',
       'description' => 'Ensure that you can perform a fresh installation.',
       'help' => 'The client failed to @type which is induced using the !patch.',
-      'summary' => 'Failed to install on @environment.',
+      'summary' => 'Failed to install',
       'confirmation' => FALSE,
     ),
     'review' => array(
@@ -116,7 +116,7 @@
       'active title' => 'detect a review run failure',
       'description' => 'Ensure that you can perform the review manually.',
       'help' => 'The client failed to @type which is induced using the !patch.',
-      'summary' => 'Failed to review on @environment: @reason.',
+      'summary' => 'Failed to review: @reason',
       'confirmation' => FALSE,
     ),
     'fail' => array(
@@ -124,7 +124,7 @@
       'active title' => 'detect a failing review',
       'description' => 'Look over the review failures below.',
       'help' => 'The client failed to @type which is induced using the !patch.',
-      'summary' => 'Failed review on @environment.',
+      'summary' => 'Failed review',
       'confirmation' => FALSE,
     ),
     'pass' => array(
@@ -132,7 +132,7 @@
       'active title' => 'complete test suite with all tests passing',
       'description' => 'Congratulation everything looks good!',
       'help' => 'Client failed to run the test suite with all tests passing.',
-      'summary' => 'Passed review on @environment.',
+      'summary' => 'Passed review',
       'confirmation' => FALSE,
     ),
   );
Index: review/assertion/pifr_assertion.server.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/review/assertion/pifr_assertion.server.inc,v
retrieving revision 1.24
diff -u -r1.24 pifr_assertion.server.inc
--- review/assertion/pifr_assertion.server.inc	17 Dec 2009 02:06:00 -0000	1.24
+++ review/assertion/pifr_assertion.server.inc	18 Dec 2009 23:56:18 -0000
@@ -37,10 +37,10 @@
   public function __construct() {
     $this->steps['fail'] = array_merge($this->steps['fail'], array(
       'description' => 'Review the test failures below then if necessary run them locally until the problem has been fixed.',
-      'summary' => 'Failed on @environment, with: ' . $this->detail_message . '.',
+      'summary' => $this->detail_message,
     ));
     $this->steps['pass'] = array_merge($this->steps['pass'], array(
-      'summary' => 'Passed on @environment, with: @pass pass(es).',
+      'summary' => '@pass pass(es)',
     ));
   }
 
Index: review/drupal/pifr_drupal.server.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/review/drupal/pifr_drupal.server.inc,v
retrieving revision 1.4
diff -u -r1.4 pifr_drupal.server.inc
--- review/drupal/pifr_drupal.server.inc	16 Dec 2009 23:08:27 -0000	1.4
+++ review/drupal/pifr_drupal.server.inc	18 Dec 2009 23:56:18 -0000
@@ -31,14 +31,14 @@
       'title' => 'invalid PHP syntax',
       'active title' => 'detect invalid PHP syntax',
       'description' => 'Check the syntax of your PHP files.',
-      'summary' => 'Invalid PHP syntax in @filename.',
+      'summary' => 'Invalid PHP syntax in @filename',
       'confirmation' => 'pifr_drupal',
     ));
     $this->steps['install'] = array_merge($this->steps['install'], array(
       'title' => 'Drupal installation failure',
       'active title' => 'detect a Drupal installation failure',
       'description' => 'Ensure that you can perform a fresh Drupal install.',
-      'summary' => 'Drupal installation failed on @environment.',
+      'summary' => 'Drupal installation failed',
       'confirmation' => 'pifr_drupal',
     ));
 
Index: review/coder/pifr_coder.server.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/review/coder/pifr_coder.server.inc,v
retrieving revision 1.4
diff -u -r1.4 pifr_coder.server.inc
--- review/coder/pifr_coder.server.inc	17 Dec 2009 02:22:42 -0000	1.4
+++ review/coder/pifr_coder.server.inc	18 Dec 2009 23:56:18 -0000
@@ -42,7 +42,7 @@
     $this->steps['pass'] = array_merge($this->steps['pass'], array(
       'title' => 'coder review passed',
       'active title' => 'complete coder review with all passed',
-      'summary' => 'Passed on @environment, with: @pass minor(s).',
+      'summary' => '@pass minor(s)',
       'confirmation' => 'pifr_coder',
     ));
   }
