mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 10:12:41 +01:00
Remove leftover code for "postponed" lint and unit status
Summary: Ref T9134. It looks like this functionality was removed in D13848. Depends on D13869. Test Plan: Ran `arc diff`, `arc lint` and `arc unit`. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Maniphest Tasks: T9134 Differential Revision: https://secure.phabricator.com/D13868
This commit is contained in:
parent
1ed98937c4
commit
10f9c460fa
7 changed files with 4 additions and 70 deletions
|
@ -57,7 +57,6 @@ abstract class ArcanistLintEngine extends Phobject {
|
||||||
private $changedLines = array();
|
private $changedLines = array();
|
||||||
|
|
||||||
private $enableAsyncLint = false;
|
private $enableAsyncLint = false;
|
||||||
private $postponedLinters = array();
|
|
||||||
private $configurationManager;
|
private $configurationManager;
|
||||||
|
|
||||||
private $linterResources = array();
|
private $linterResources = array();
|
||||||
|
@ -403,15 +402,6 @@ abstract class ArcanistLintEngine extends Phobject {
|
||||||
return array($line, $char);
|
return array($line, $char);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getPostponedLinters() {
|
|
||||||
return $this->postponedLinters;
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function setPostponedLinters(array $linters) {
|
|
||||||
$this->postponedLinters = $linters;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getCacheVersion() {
|
protected function getCacheVersion() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ final class ArcanistUnitTestResult extends Phobject {
|
||||||
const RESULT_SKIP = 'skip';
|
const RESULT_SKIP = 'skip';
|
||||||
const RESULT_BROKEN = 'broken';
|
const RESULT_BROKEN = 'broken';
|
||||||
const RESULT_UNSOUND = 'unsound';
|
const RESULT_UNSOUND = 'unsound';
|
||||||
const RESULT_POSTPONED = 'postponed';
|
|
||||||
|
|
||||||
private $namespace;
|
private $namespace;
|
||||||
private $name;
|
private $name;
|
||||||
|
|
|
@ -28,13 +28,6 @@ final class ArcanistUnitConsoleRenderer extends ArcanistUnitRenderer {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderPostponedResult($count) {
|
|
||||||
return sprintf(
|
|
||||||
"%s %s\n",
|
|
||||||
$this->getFormattedResult(ArcanistUnitTestResult::RESULT_POSTPONED),
|
|
||||||
pht('%d test(s)', $count));
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getFormattedResult($result) {
|
private function getFormattedResult($result) {
|
||||||
switch ($result) {
|
switch ($result) {
|
||||||
case ArcanistUnitTestResult::RESULT_PASS:
|
case ArcanistUnitTestResult::RESULT_PASS:
|
||||||
|
@ -54,11 +47,6 @@ final class ArcanistUnitConsoleRenderer extends ArcanistUnitRenderer {
|
||||||
'<bg:yellow>** %s **</bg>',
|
'<bg:yellow>** %s **</bg>',
|
||||||
pht('UNSOUND'));
|
pht('UNSOUND'));
|
||||||
|
|
||||||
case ArcanistUnitTestResult::RESULT_POSTPONED:
|
|
||||||
return phutil_console_format(
|
|
||||||
'<bg:yellow>** %s **</bg>',
|
|
||||||
pht('POSTPONED'));
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
|
|
||||||
abstract class ArcanistUnitRenderer extends Phobject {
|
abstract class ArcanistUnitRenderer extends Phobject {
|
||||||
abstract public function renderUnitResult(ArcanistUnitTestResult $result);
|
abstract public function renderUnitResult(ArcanistUnitTestResult $result);
|
||||||
abstract public function renderPostponedResult($count);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ final class ArcanistDiffWorkflow extends ArcanistWorkflow {
|
||||||
private $testResults;
|
private $testResults;
|
||||||
private $diffID;
|
private $diffID;
|
||||||
private $revisionID;
|
private $revisionID;
|
||||||
private $postponedLinters;
|
|
||||||
private $haveUncommittedChanges = false;
|
private $haveUncommittedChanges = false;
|
||||||
private $diffPropertyFutures = array();
|
private $diffPropertyFutures = array();
|
||||||
private $commitMessageFromRevision;
|
private $commitMessageFromRevision;
|
||||||
|
@ -476,7 +475,6 @@ EOTEXT
|
||||||
|
|
||||||
$lint_result = $data['lintResult'];
|
$lint_result = $data['lintResult'];
|
||||||
$this->unresolvedLint = $data['unresolvedLint'];
|
$this->unresolvedLint = $data['unresolvedLint'];
|
||||||
$this->postponedLinters = $data['postponedLinters'];
|
|
||||||
$unit_result = $data['unitResult'];
|
$unit_result = $data['unitResult'];
|
||||||
$this->testResults = $data['testResults'];
|
$this->testResults = $data['testResults'];
|
||||||
|
|
||||||
|
@ -1222,7 +1220,6 @@ EOTEXT
|
||||||
return array(
|
return array(
|
||||||
'lintResult' => $lint_result,
|
'lintResult' => $lint_result,
|
||||||
'unresolvedLint' => $this->unresolvedLint,
|
'unresolvedLint' => $this->unresolvedLint,
|
||||||
'postponedLinters' => $this->postponedLinters,
|
|
||||||
'unitResult' => $unit_result,
|
'unitResult' => $unit_result,
|
||||||
'testResults' => $this->testResults,
|
'testResults' => $this->testResults,
|
||||||
);
|
);
|
||||||
|
@ -1290,12 +1287,6 @@ EOTEXT
|
||||||
pht('Lint issued unresolved errors!'),
|
pht('Lint issued unresolved errors!'),
|
||||||
'lint-excuses');
|
'lint-excuses');
|
||||||
break;
|
break;
|
||||||
case ArcanistLintWorkflow::RESULT_POSTPONED:
|
|
||||||
$this->console->writeOut(
|
|
||||||
"<bg:yellow>** %s **</bg> %s\n",
|
|
||||||
pht('LINT POSTPONED'),
|
|
||||||
pht('Lint results are postponed.'));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->unresolvedLint = array();
|
$this->unresolvedLint = array();
|
||||||
|
@ -1303,8 +1294,6 @@ EOTEXT
|
||||||
$this->unresolvedLint[] = $message->toDictionary();
|
$this->unresolvedLint[] = $message->toDictionary();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->postponedLinters = $lint_workflow->getPostponedLinters();
|
|
||||||
|
|
||||||
return $lint_result;
|
return $lint_result;
|
||||||
} catch (ArcanistNoEngineException $ex) {
|
} catch (ArcanistNoEngineException $ex) {
|
||||||
$this->console->writeOut(
|
$this->console->writeOut(
|
||||||
|
@ -2260,7 +2249,6 @@ EOTEXT
|
||||||
ArcanistLintWorkflow::RESULT_ERRORS => 'fail',
|
ArcanistLintWorkflow::RESULT_ERRORS => 'fail',
|
||||||
ArcanistLintWorkflow::RESULT_WARNINGS => 'warn',
|
ArcanistLintWorkflow::RESULT_WARNINGS => 'warn',
|
||||||
ArcanistLintWorkflow::RESULT_SKIP => 'skip',
|
ArcanistLintWorkflow::RESULT_SKIP => 'skip',
|
||||||
ArcanistLintWorkflow::RESULT_POSTPONED => 'postponed',
|
|
||||||
);
|
);
|
||||||
return idx($map, $lint_result, 'none');
|
return idx($map, $lint_result, 'none');
|
||||||
}
|
}
|
||||||
|
@ -2275,7 +2263,6 @@ EOTEXT
|
||||||
ArcanistUnitWorkflow::RESULT_FAIL => 'fail',
|
ArcanistUnitWorkflow::RESULT_FAIL => 'fail',
|
||||||
ArcanistUnitWorkflow::RESULT_UNSOUND => 'warn',
|
ArcanistUnitWorkflow::RESULT_UNSOUND => 'warn',
|
||||||
ArcanistUnitWorkflow::RESULT_SKIP => 'skip',
|
ArcanistUnitWorkflow::RESULT_SKIP => 'skip',
|
||||||
ArcanistUnitWorkflow::RESULT_POSTPONED => 'postponed',
|
|
||||||
);
|
);
|
||||||
return idx($map, $unit_result, 'none');
|
return idx($map, $unit_result, 'none');
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ final class ArcanistLintWorkflow extends ArcanistWorkflow {
|
||||||
const RESULT_WARNINGS = 1;
|
const RESULT_WARNINGS = 1;
|
||||||
const RESULT_ERRORS = 2;
|
const RESULT_ERRORS = 2;
|
||||||
const RESULT_SKIP = 3;
|
const RESULT_SKIP = 3;
|
||||||
const RESULT_POSTPONED = 4;
|
|
||||||
|
|
||||||
const DEFAULT_SEVERITY = ArcanistLintSeverity::SEVERITY_ADVICE;
|
const DEFAULT_SEVERITY = ArcanistLintSeverity::SEVERITY_ADVICE;
|
||||||
|
|
||||||
|
@ -19,7 +18,6 @@ final class ArcanistLintWorkflow extends ArcanistWorkflow {
|
||||||
private $shouldAmendWithoutPrompt = false;
|
private $shouldAmendWithoutPrompt = false;
|
||||||
private $shouldAmendAutofixesWithoutPrompt = false;
|
private $shouldAmendAutofixesWithoutPrompt = false;
|
||||||
private $engine;
|
private $engine;
|
||||||
private $postponedLinters;
|
|
||||||
|
|
||||||
public function getWorkflowName() {
|
public function getWorkflowName() {
|
||||||
return 'lint';
|
return 'lint';
|
||||||
|
@ -399,12 +397,6 @@ EOTEXT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// It'd be nice to just return a single result from the run method above
|
|
||||||
// which contains both the lint messages and the postponed linters.
|
|
||||||
// However, to maintain compatibility with existing lint subclasses, use
|
|
||||||
// a separate method call to grab the postponed linters.
|
|
||||||
$this->postponedLinters = $engine->getPostponedLinters();
|
|
||||||
|
|
||||||
if ($this->getArgument('never-apply-patches')) {
|
if ($this->getArgument('never-apply-patches')) {
|
||||||
$apply_patches = false;
|
$apply_patches = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -650,8 +642,6 @@ EOTEXT
|
||||||
$result_code = self::RESULT_ERRORS;
|
$result_code = self::RESULT_ERRORS;
|
||||||
} else if ($has_warnings) {
|
} else if ($has_warnings) {
|
||||||
$result_code = self::RESULT_WARNINGS;
|
$result_code = self::RESULT_WARNINGS;
|
||||||
} else if (!empty($this->postponedLinters)) {
|
|
||||||
$result_code = self::RESULT_POSTPONED;
|
|
||||||
} else {
|
} else {
|
||||||
$result_code = self::RESULT_OKAY;
|
$result_code = self::RESULT_OKAY;
|
||||||
}
|
}
|
||||||
|
@ -669,8 +659,4 @@ EOTEXT
|
||||||
return $this->unresolvedMessages;
|
return $this->unresolvedMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPostponedLinters() {
|
|
||||||
return $this->postponedLinters;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ final class ArcanistUnitWorkflow extends ArcanistWorkflow {
|
||||||
const RESULT_UNSOUND = 1;
|
const RESULT_UNSOUND = 1;
|
||||||
const RESULT_FAIL = 2;
|
const RESULT_FAIL = 2;
|
||||||
const RESULT_SKIP = 3;
|
const RESULT_SKIP = 3;
|
||||||
const RESULT_POSTPONED = 4;
|
|
||||||
|
|
||||||
private $unresolvedTests;
|
private $unresolvedTests;
|
||||||
private $testResults;
|
private $testResults;
|
||||||
|
@ -175,31 +174,20 @@ EOTEXT
|
||||||
|
|
||||||
$unresolved = array();
|
$unresolved = array();
|
||||||
$coverage = array();
|
$coverage = array();
|
||||||
$postponed_count = 0;
|
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
$result_code = $result->getResult();
|
$result_code = $result->getResult();
|
||||||
if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED) {
|
|
||||||
$postponed_count++;
|
|
||||||
$unresolved[] = $result;
|
|
||||||
} else {
|
|
||||||
if ($this->engine->shouldEchoTestResults()) {
|
if ($this->engine->shouldEchoTestResults()) {
|
||||||
$console->writeOut('%s', $renderer->renderUnitResult($result));
|
$console->writeOut('%s', $renderer->renderUnitResult($result));
|
||||||
}
|
}
|
||||||
if ($result_code != ArcanistUnitTestResult::RESULT_PASS) {
|
if ($result_code != ArcanistUnitTestResult::RESULT_PASS) {
|
||||||
$unresolved[] = $result;
|
$unresolved[] = $result;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($result->getCoverage()) {
|
if ($result->getCoverage()) {
|
||||||
foreach ($result->getCoverage() as $file => $report) {
|
foreach ($result->getCoverage() as $file => $report) {
|
||||||
$coverage[$file][] = $report;
|
$coverage[$file][] = $report;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($postponed_count) {
|
|
||||||
$console->writeOut(
|
|
||||||
'%s',
|
|
||||||
$renderer->renderPostponedResult($postponed_count));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($coverage) {
|
if ($coverage) {
|
||||||
$file_coverage = array_fill_keys(
|
$file_coverage = array_fill_keys(
|
||||||
|
@ -252,9 +240,6 @@ EOTEXT
|
||||||
break;
|
break;
|
||||||
} else if ($result_code == ArcanistUnitTestResult::RESULT_UNSOUND) {
|
} else if ($result_code == ArcanistUnitTestResult::RESULT_UNSOUND) {
|
||||||
$overall_result = self::RESULT_UNSOUND;
|
$overall_result = self::RESULT_UNSOUND;
|
||||||
} else if ($result_code == ArcanistUnitTestResult::RESULT_POSTPONED &&
|
|
||||||
$overall_result != self::RESULT_UNSOUND) {
|
|
||||||
$overall_result = self::RESULT_POSTPONED;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue