Skip to content

Commit

Permalink
test: Print output when job fails
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Dec 10, 2024
1 parent b919e01 commit df0be97
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -4877,7 +4877,15 @@ public function userShareLastNotificationFile(string $user, string $firstLast, s
*/
public function runReminderBackgroundJobs(string $useForce, string $class, bool $repeated = false): void {
$this->runOcc(['background-job:list', '--output=json_pretty', '--class=' . $class]);
$list = json_decode($this->lastStdOut, true, 512, JSON_THROW_ON_ERROR);
try {
$list = json_decode($this->lastStdOut, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
var_dump('Output');
var_dump($this->lastStdOut);
var_dump('Error');
var_dump($this->lastStdErr);
throw $e;
}

if ($repeated && empty($list)) {
return;
Expand Down

0 comments on commit df0be97

Please sign in to comment.