Page MenuHomePhabricator

arc-unit-sorting

Authored By
richardvanvelzen
Nov 6 2017, 12:37 PM
Size
1 KB
Referenced Files
None
Subscribers
None

arc-unit-sorting

diff --git a/src/unit/ArcanistUnitTestResult.php b/src/unit/ArcanistUnitTestResult.php
index ec25c20f..9a5f6d78 100644
--- a/src/unit/ArcanistUnitTestResult.php
+++ b/src/unit/ArcanistUnitTestResult.php
@@ -174,6 +174,13 @@ final class ArcanistUnitTestResult extends Phobject {
);
}
+ public function getSortVector() {
+ return (new PhutilSortVector())
+ ->addInt($this->getResult() === self::RESULT_PASS ? 0 : 1)
+ ->addString($this->getResult())
+ ->addInt($this->getDuration() * 1000);
+ }
+
public static function getAllResultCodes() {
return array(
self::RESULT_PASS,
diff --git a/src/workflow/ArcanistUnitWorkflow.php b/src/workflow/ArcanistUnitWorkflow.php
index 00ef8a59..f8eb7488 100644
--- a/src/workflow/ArcanistUnitWorkflow.php
+++ b/src/workflow/ArcanistUnitWorkflow.php
@@ -165,6 +165,7 @@ EOTEXT
$this->engine->setEnableCoverage($enable_coverage);
$results = $this->engine->run();
+ $results = msortv($results, 'getSortVector');
$this->validateUnitEngineResults($this->engine, $results);

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
833730
Default Alt Text
arc-unit-sorting (1 KB)

Event Timeline