@@ -119,10 +119,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
119
119
* @param OutputInterface $output
120
120
* @return void
121
121
* @throws TestFrameworkException
122
+ * @throws \Exception
122
123
*/
123
124
private function runTests (array $ tests , OutputInterface $ output )
124
125
{
125
- $ codeceptionCommand = realpath (PROJECT_ROOT . '/vendor/bin/codecept ' ) . ' run functional ' ;
126
+ if ($ this ->pauseEnabled ()) {
127
+ $ codeceptionCommand = self ::CODECEPT_RUN_COMMAND ;
128
+ } else {
129
+ $ codeceptionCommand = realpath (PROJECT_ROOT . '/vendor/bin/codecept ' ) . ' run functional ' ;
130
+ }
131
+
126
132
$ testsDirectory = FilePathFormatter::format (TESTS_MODULE_PATH ) .
127
133
TestGenerator::GENERATED_DIR .
128
134
DIRECTORY_SEPARATOR .
@@ -136,11 +142,14 @@ private function runTests(array $tests, OutputInterface $output)
136
142
$ testName . " is not available under " . $ testsDirectory
137
143
);
138
144
}
139
- $ fullCommand = $ codeceptionCommand . $ testsDirectory . $ testName . ' --verbose --steps ' ;
145
+
140
146
if ($ this ->pauseEnabled ()) {
141
- $ fullCommand .= ' --debug ' ;
147
+ $ fullCommand = $ codeceptionCommand . $ testsDirectory . $ testName . ' --verbose --steps --debug ' ;
148
+ $ this ->returnCode = max ($ this ->returnCode , $ this ->codeceptRunTest ($ fullCommand , $ output ));
149
+ } else {
150
+ $ fullCommand = $ codeceptionCommand . $ testsDirectory . $ testName . ' --verbose --steps ' ;
151
+ $ this ->returnCode = max ($ this ->returnCode , $ this ->executeTestCommand ($ fullCommand , $ output ));
142
152
}
143
- $ this ->returnCode = max ($ this ->returnCode , $ this ->executeTestCommand ($ fullCommand , $ output ));
144
153
}
145
154
}
146
155
@@ -150,17 +159,24 @@ private function runTests(array $tests, OutputInterface $output)
150
159
* @param array $suitesConfig
151
160
* @param OutputInterface $output
152
161
* @return void
162
+ * @throws \Exception
153
163
*/
154
164
private function runTestsInSuite (array $ suitesConfig , OutputInterface $ output )
155
165
{
156
- $ codeceptionCommand = realpath (PROJECT_ROOT . '/vendor/bin/codecept ' ) . ' run functional --verbose --steps ' ;
157
166
if ($ this ->pauseEnabled ()) {
158
- $ codeceptionCommand .= ' --debug ' ;
167
+ $ codeceptionCommand = self ::CODECEPT_RUN_COMMAND . '--verbose --steps --debug ' ;
168
+ } else {
169
+ $ codeceptionCommand = realpath (PROJECT_ROOT . '/vendor/bin/codecept ' )
170
+ . ' run functional --verbose --steps ' ;
159
171
}
160
172
//for tests in suites, run them as a group to run before and after block
161
173
foreach (array_keys ($ suitesConfig ) as $ suite ) {
162
174
$ fullCommand = $ codeceptionCommand . " -g {$ suite }" ;
163
- $ this ->returnCode = max ($ this ->returnCode , $ this ->executeTestCommand ($ fullCommand , $ output ));
175
+ if ($ this ->pauseEnabled ()) {
176
+ $ this ->returnCode = max ($ this ->returnCode , $ this ->codeceptRunTest ($ fullCommand , $ output ));
177
+ } else {
178
+ $ this ->returnCode = max ($ this ->returnCode , $ this ->executeTestCommand ($ fullCommand , $ output ));
179
+ }
164
180
}
165
181
}
166
182
@@ -179,9 +195,7 @@ private function executeTestCommand(string $command, OutputInterface $output)
179
195
$ process ->setWorkingDirectory (TESTS_BP );
180
196
$ process ->setIdleTimeout (600 );
181
197
$ process ->setTimeout (0 );
182
- if ($ this ->pauseEnabled ()) {
183
- $ process ->setInput (STDIN );
184
- }
198
+
185
199
return $ process ->run (function ($ type , $ buffer ) use ($ output ) {
186
200
$ output ->write ($ buffer );
187
201
});
0 commit comments