Skip to content

Commit

Permalink
Fix: Allow using duration as value for order-by option via CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed May 5, 2019
1 parent 14daebe commit 091216b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/TextUI/Command.php
Expand Up @@ -1158,7 +1158,7 @@ protected function showHelp(): void
--printer <printer> TestListener implementation to use
--resolve-dependencies Resolve dependencies between tests
--order-by=<order> Run tests in order: default|reverse|random|defects|depends
--order-by=<order> Run tests in order: default|reverse|random|defects|depends|duration
--random-order-seed=<N> Use a specific random seed <N> for random order
--cache-result Write run result to cache to enable ordering tests defects-first
Expand Down Expand Up @@ -1366,6 +1366,11 @@ private function handleOrderByOption(string $value): void

break;

case 'duration':
$this->arguments['executionOrder'] = TestSuiteSorter::ORDER_DURATION;

break;

default:
$this->exitWithErrorMessage("unrecognized --order-by option: $order");
}
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/help.phpt
Expand Up @@ -88,7 +88,7 @@ Test Execution Options:
--printer <printer> TestListener implementation to use

--resolve-dependencies Resolve dependencies between tests
--order-by=<order> Run tests in order: default|reverse|random|defects|depends
--order-by=<order> Run tests in order: default|reverse|random|defects|depends|duration
--random-order-seed=<N> Use a specific random seed <N> for random order
--cache-result Write run result to cache to enable ordering tests defects-first

Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/help2.phpt
Expand Up @@ -89,7 +89,7 @@ Test Execution Options:
--printer <printer> TestListener implementation to use

--resolve-dependencies Resolve dependencies between tests
--order-by=<order> Run tests in order: default|reverse|random|defects|depends
--order-by=<order> Run tests in order: default|reverse|random|defects|depends|duration
--random-order-seed=<N> Use a specific random seed <N> for random order
--cache-result Write run result to cache to enable ordering tests defects-first

Expand Down

0 comments on commit 091216b

Please sign in to comment.