Skip to content

Commit

Permalink
Fix: Allow ordering tests by duration via CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed May 5, 2019
1 parent 544c24c commit a94016c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/TextUI/Command.php
Expand Up @@ -1257,6 +1257,11 @@ private function handleOrderByOption(string $value): void

break;

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

break;

case 'reverse':
$this->arguments['executionOrder'] = TestSuiteSorter::ORDER_REVERSED;

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|reverse|random|defects|no-depends'],
['arg' => '--order-by=<order>', 'desc' => 'Run tests in order: default|duration|reverse|random|defects|no-depends'],
['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

0 comments on commit a94016c

Please sign in to comment.