From dcc76bb58bd785da8cad1bc295a9e9a7d1ffd316 Mon Sep 17 00:00:00 2001 From: tuomaspelkonen Date: Wed, 8 Jun 2011 16:36:17 -0700 Subject: [PATCH] Send postponed test results to differential. Summary: Differential showed 'okay' as the arc unit status even when there were postponed tests. Test Plan: Tested that test results were pushed to differential when there were postponed tests. Reviewed By: jungejason Reviewers: epriestley, jungejason CC: slawekbiel, aran, jungejason Differential Revision: 417 --- src/workflow/diff/ArcanistDiffWorkflow.php | 2 ++ src/workflow/unit/ArcanistUnitWorkflow.php | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/workflow/diff/ArcanistDiffWorkflow.php b/src/workflow/diff/ArcanistDiffWorkflow.php index f21e5f67..25ff3d33 100644 --- a/src/workflow/diff/ArcanistDiffWorkflow.php +++ b/src/workflow/diff/ArcanistDiffWorkflow.php @@ -244,6 +244,8 @@ EOTEXT $unit = 'warn'; } else if ($unit_result === ArcanistUnitWorkflow::RESULT_SKIP) { $unit = 'skip'; + } else if ($unit_result === ArcanistUnitWorkflow::RESULT_POSTPONED) { + $unit = 'postponed'; } else { $unit = 'none'; } diff --git a/src/workflow/unit/ArcanistUnitWorkflow.php b/src/workflow/unit/ArcanistUnitWorkflow.php index 46c6511b..cc92c616 100644 --- a/src/workflow/unit/ArcanistUnitWorkflow.php +++ b/src/workflow/unit/ArcanistUnitWorkflow.php @@ -23,10 +23,11 @@ */ class ArcanistUnitWorkflow extends ArcanistBaseWorkflow { - const RESULT_OKAY = 0; - const RESULT_UNSOUND = 1; - const RESULT_FAIL = 2; - const RESULT_SKIP = 3; + const RESULT_OKAY = 0; + const RESULT_UNSOUND = 1; + const RESULT_FAIL = 2; + const RESULT_SKIP = 3; + const RESULT_POSTPONED = 4; private $unresolvedTests; private $engine; @@ -121,6 +122,7 @@ EOTEXT $result_code = $result->getResult(); if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED) { $postponed_count++; + $unresolved[] = $result; } else { if ($this->engine->shouldEchoTestResults()) { echo ' '.$status_codes[$result_code].' '.$result->getName()."\n"; @@ -151,6 +153,9 @@ EOTEXT break; } else if ($result_code == ArcanistUnitTestResult::RESULT_UNSOUND) { $overall_result = self::RESULT_UNSOUND; + } else if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED && + $overall_result != self::RESULT_UNSOUND) { + $overall_result = self::RESULT_POSTPONED; } }