Skip to content

Commit

Permalink
Fix: Handle duration as order-by option value on CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed May 5, 2019
1 parent 73ad254 commit ec6fb40
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/TextUI/Command.php
Expand Up @@ -1267,6 +1267,11 @@ private function handleOrderByOption(string $value): void

break;

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

break;

case 'no-depends':
$this->arguments['resolveDependencies'] = false;

Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/Help.php
Expand Up @@ -100,7 +100,7 @@ final class Help
['arg' => '--printer <printer>', 'desc' => 'TestListener implementation to use'],
['spacer' => ''],

['arg' => '--order-by=<order>', 'desc' => 'Run tests in order: default|defects|depends|no-depends|random|reverse'],
['arg' => '--order-by=<order>', 'desc' => 'Run tests in order: default|defects|depends|duration|no-depends|random|reverse'],
['arg' => '--random-order-seed=<N>', 'desc' => 'Use a specific random seed <N> for random order'],
['arg' => '--cache-result', 'desc' => 'Write test results to cache file'],
['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'],
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/cli/_files/output-cli-help-color.txt
Expand Up @@ -99,7 +99,7 @@
--printer <printer>  TestListener implementation to use

--order-by=<order>  Run tests in order:
default|defects|depends|no-depends|random|reverse
default|defects|depends|duration|no-depends|random|reverse
--random-order-seed=<N>  Use a specific random seed <N> for random
order
--cache-result  Write test results to cache file
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/cli/_files/output-cli-usage.txt
Expand Up @@ -77,7 +77,7 @@ Test Execution Options:
--testdox-exclude-group Exclude tests from the specified group(s)
--printer <printer> TestListener implementation to use

--order-by=<order> Run tests in order: default|defects|depends|no-depends|random|reverse
--order-by=<order> Run tests in order: default|defects|depends|duration|no-depends|random|reverse
--random-order-seed=<N> Use a specific random seed <N> for random order
--cache-result Write test results to cache file
--do-not-cache-result Do not write test results to cache file
Expand Down

0 comments on commit ec6fb40

Please sign in to comment.