Page MenuHomePhabricator
Paste P2078

arc-unit-sorting
ActivePublic

Authored by richardvanvelzen on Nov 6 2017, 12:37 PM.
Tags
None
Referenced Files
F5261937: arc-unit-sorting
Nov 6 2017, 12:37 PM
Subscribers
None
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);

Event Timeline

richardvanvelzen changed the title of this paste from untitled to arc-unit-sorting.
richardvanvelzen updated the paste's language from autodetect to autodetect.