Skip to content

Commit

Permalink
Skip data_converter/failure last check
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Oct 8, 2024
1 parent ecb9300 commit fe0bf03
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions features/data_converter/failure/feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Harness\Attribute\Check;
use Harness\Attribute\Stub;
use Harness\Exception\SkipTest;
use Temporal\Activity\ActivityInterface;
use Temporal\Activity\ActivityMethod;
use Temporal\Activity\ActivityOptions;
Expand Down Expand Up @@ -88,6 +89,7 @@ public function check(
Assert::isInstanceOf($failure, Failure::class);
\assert($failure instanceof Failure);

throw new SkipTest('SDK does not format Failure message as expected');
$this->checkFailure($failure, 'main error');
$this->checkFailure($failure->getCause(), 'cause error');
}
Expand Down
4 changes: 4 additions & 0 deletions harness/php/runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Harness\Exception\SkipTest;
use Harness\Feature\WorkflowStubInjector;
use Harness\Runtime\Feature;
use Harness\Runtime\Runner;
Expand Down Expand Up @@ -108,6 +109,9 @@ static function (Container $container) use ($definition) {
echo "\e[1;32mSUCCESS\e[0m\n";
},
);
} catch (SkipTest $e) {
echo "\e[1;33mSKIPPED\e[0m\n";
echo "\e[35m{$e->reason}\e[0m\n";
} catch (\Throwable $e) {
echo "\e[1;31mFAILED\e[0m\n";

Expand Down
13 changes: 13 additions & 0 deletions harness/php/src/Exception/SkipTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Harness\Exception;

final class SkipTest extends \RuntimeException
{
public function __construct(
public readonly string $reason,
) {
}
}

0 comments on commit fe0bf03

Please sign in to comment.