Skip to content

Commit

Permalink
add coverage, profile and parallel options to Test command
Browse files Browse the repository at this point in the history
  • Loading branch information
MoamenEltouny authored May 29, 2024
1 parent 9be2ad5 commit 8a7ebf8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Core/Commands/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class Test extends Command

protected $signature = 'module:test {module}
{--l|list : Get tests list}
{--profile : Lists top 10 slowest tests}
{--coverage : Indicates whether code coverage information should be collected}
{--p|parallel : Indicates if the tests should run in parallel}
{--s|stop-on-failure : Stop all tests on the failure status}
{--f|filter= : Test name (example: UserTest)}';

Expand All @@ -28,8 +31,11 @@ protected function exec()
} else {
if ($filter = $this->option('filter')) $command .= ' --filter=' . $filter;
if ($this->option('stop-on-failure')) $command .= ' --stop-on-failure';
if ($this->option('coverage')) $command .= ' --coverage';
if ($this->option('profile')) $command .= ' --profile';
if ($this->option('parallel')) $command .= ' --parallel';
}

$process = Process::fromShellCommandline($command);
$process->setPty(true);
$process->run();
Expand Down

0 comments on commit 8a7ebf8

Please sign in to comment.