Skip to content

Commit 4560e27

Browse files
committed
test: print log record on a test failure
1 parent 852d6ab commit 4560e27

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

tests/Acceptance/App/TestCase.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,21 @@ function (Container $container): mixed {
6767
if ($e instanceof TemporalException) {
6868
echo "\n=== Workflow history for failed test {$this->name()} ===\n";
6969
$this->printWorkflowHistory($container->get(WorkflowClientInterface::class), $args);
70+
71+
$logRecords = $container->get(ClientLogger::class)->getRecords();
72+
if ($logRecords !== []) {
73+
echo "\n=== Client log records ===\n";
74+
foreach ($logRecords as $record) {
75+
echo \sprintf(
76+
"[%s] %s%s\n",
77+
$record->level,
78+
$record->message,
79+
\json_encode($record->context, JSON_UNESCAPED_UNICODE),
80+
);
81+
}
82+
}
83+
84+
echo "\n\n";
7085
}
7186

7287
throw $e;

tests/Acceptance/Extra/Update/DynamicUpdateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DynamicUpdateTest extends TestCase
2222
{
2323
#[Test]
2424
public function addUpdateMethodWithoutValidation(
25-
#[Client(timeout: 10.0)]
25+
#[Client(timeout: 15.0)]
2626
#[Stub('Extra_Update_DynamicUpdate')]
2727
WorkflowStubInterface $stub,
2828
): void {

0 commit comments

Comments
 (0)