]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Add extraData field to test results
authorWez Furlong <wez@fb.com>
Wed, 15 Aug 2012 17:34:29 +0000 (10:34 -0700)
committerWez Furlong <wez@fb.com>
Wed, 15 Aug 2012 17:34:29 +0000 (10:34 -0700)
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
src/workflow/ArcanistDiffWorkflow.php

index ef8e8d7948a6d45c5aef12081b1dd4e926a21c88..021e22646498c824ffbaf1e5054db52c2bd95fb1 100644 (file)
@@ -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;
index 1e2c940462333f7afbe68d11372c26d0869bb4e8..c4ab3abf109404640c3a839019d86ffa10208059 100644 (file)
@@ -1319,6 +1319,7 @@ EOTEXT
           'result'    => $test->getResult(),
           'userdata'  => $test->getUserData(),
           'coverage'  => $test->getCoverage(),
+          'extra'     => $test->getExtraData(),
         );
       }