|
8 | 8 | namespace Magento\FunctionalTestingFramework\Console;
|
9 | 9 |
|
10 | 10 | use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
|
| 11 | +use Magento\FunctionalTestingFramework\Util\TestGenerator; |
11 | 12 | use Symfony\Component\Console\Input\ArrayInput;
|
12 | 13 | use Symfony\Component\Console\Input\InputArgument;
|
13 | 14 | use Symfony\Component\Console\Input\InputInterface;
|
@@ -88,18 +89,32 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|
88 | 89 | $command->run(new ArrayInput($args), $output);
|
89 | 90 | }
|
90 | 91 |
|
91 |
| - // we only generate relevant tests here so we can execute "all tests" |
92 |
| - $codeceptionCommand = realpath(PROJECT_ROOT . '/vendor/bin/codecept') . " run functional --verbose --steps"; |
| 92 | + $returnCode = 0; |
| 93 | + //execute only tests specified as arguments in run command |
| 94 | + foreach ($tests as $test) { |
| 95 | + $codeceptionCommand = realpath(PROJECT_ROOT . '/vendor/bin/codecept') . ' run functional '; |
| 96 | + $test = TESTS_MODULE_PATH . |
| 97 | + DIRECTORY_SEPARATOR . |
| 98 | + TestGenerator::GENERATED_DIR . |
| 99 | + DIRECTORY_SEPARATOR . |
| 100 | + TestGenerator::DEFAULT_DIR . |
| 101 | + DIRECTORY_SEPARATOR . |
| 102 | + $test . |
| 103 | + 'Cest.php'; |
| 104 | + $codeceptionCommand .= $test; |
| 105 | + $codeceptionCommand .= ' --verbose --steps'; |
93 | 106 |
|
94 |
| - $process = new Process($codeceptionCommand); |
95 |
| - $process->setWorkingDirectory(TESTS_BP); |
96 |
| - $process->setIdleTimeout(600); |
97 |
| - $process->setTimeout(0); |
| 107 | + $process = new Process($codeceptionCommand); |
| 108 | + $process->setWorkingDirectory(TESTS_BP); |
| 109 | + $process->setIdleTimeout(600); |
| 110 | + $process->setTimeout(0); |
98 | 111 |
|
99 |
| - return $process->run( |
100 |
| - function ($type, $buffer) use ($output) { |
101 |
| - $output->write($buffer); |
102 |
| - } |
103 |
| - ); |
| 112 | + $returnCode = max($returnCode, $process->run( |
| 113 | + function ($type, $buffer) use ($output) { |
| 114 | + $output->write($buffer); |
| 115 | + } |
| 116 | + )); |
| 117 | + } |
| 118 | + return $returnCode; |
104 | 119 | }
|
105 | 120 | }
|
0 commit comments