From 390bb280e13418dd02c8b9cfa64565a6d5cbc8a4 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 15 Aug 2012 10:34:29 -0700 Subject: [PATCH] Add extraData field to test results Summary: See discussion on T1630. extraData provides more scope for extensions to piggy-back more data on the test results and have that pulled up to the UI. We're using keys like "facebook:complexity" to store additional data as part of the test results. Test Plan: Nothing in the codebase touches extraData at the moment, so you'll just have to have faith/prove by inspection. Reviewers: vrana, nh, tuomaspelkonen, epriestley Reviewed By: epriestley CC: aran, epriestley Maniphest Tasks: T1630 Differential Revision: https://secure.phabricator.com/D3276 --- src/unit/ArcanistUnitTestResult.php | 14 ++++++++++++++ src/workflow/ArcanistDiffWorkflow.php | 1 + 2 files changed, 15 insertions(+) diff --git a/src/unit/ArcanistUnitTestResult.php b/src/unit/ArcanistUnitTestResult.php index ef8e8d79..021e2264 100644 --- a/src/unit/ArcanistUnitTestResult.php +++ b/src/unit/ArcanistUnitTestResult.php @@ -35,6 +35,7 @@ final class ArcanistUnitTestResult { private $result; private $duration; private $userData; + private $extraData; private $coverage; public function setName($name) { @@ -73,6 +74,19 @@ final class ArcanistUnitTestResult { return $this->userData; } + /** + * "extra data" allows an implementation to store additional + * key/value metadata along with the result of the test run. + */ + public function setExtraData(array $extra_data = null) { + $this->extraData = $extra_data; + return $this; + } + + public function getExtraData() { + return $this->extraData; + } + public function setCoverage($coverage) { $this->coverage = $coverage; return $this; diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 1e2c9404..c4ab3abf 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -1319,6 +1319,7 @@ EOTEXT 'result' => $test->getResult(), 'userdata' => $test->getUserData(), 'coverage' => $test->getCoverage(), + 'extra' => $test->getExtraData(), ); }