From d70e5db39ea3276b30f5984defd2d139e782504a Mon Sep 17 00:00:00 2001 From: slawekbiel Date: Thu, 28 Apr 2011 11:46:20 -0700 Subject: [PATCH] Aggregate display of postponed tests Summary: Displaying each postponed test separately was spammy. Now it will only display a single line with the total count Test Plan: ~/local/arcanist/bin/arc unit --sandcastle-tests 35 tests to run. Completed 'ParentInfoTestCase.php' Interrupted 'MentionsUntagTestCase.php' PASS ParentInfoTestCase POSTPONED 34 tests Reviewed By: sgrimm Reviewers: jungejason, sgrimm CC: sgrimm Revert Plan: sure Other Notes: Differential Revision: 173 --- src/workflow/unit/ArcanistUnitWorkflow.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/workflow/unit/ArcanistUnitWorkflow.php b/src/workflow/unit/ArcanistUnitWorkflow.php index 567a7369..c706ce9e 100644 --- a/src/workflow/unit/ArcanistUnitWorkflow.php +++ b/src/workflow/unit/ArcanistUnitWorkflow.php @@ -115,14 +115,26 @@ EOTEXT ); $unresolved = array(); + $postponed_count = 0; foreach ($results as $result) { $result_code = $result->getResult(); - echo $status_codes[$result_code].' '.$result->getName()."\n"; - if ($result_code != ArcanistUnitTestResult::RESULT_PASS) { - echo $result->getUserData()."\n"; - $unresolved[] = $result; + if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED) { + $postponed_count++; + } else { + echo $status_codes[$result_code].' '.$result->getName()."\n"; + if ($result_code != ArcanistUnitTestResult::RESULT_PASS) { + echo $result->getUserData()."\n"; + $unresolved[] = $result; + } } } + if ($postponed_count) { + echo sprintf("%s %d %s\n", + $status_codes[ArcanistUnitTestResult::RESULT_POSTPONED], + $postponed_count, + ($postponed_count > 1)?'tests':'test'); + } + $this->unresolvedTests = $unresolved; $overall_result = self::RESULT_OKAY;