Skip to content

Commit

Permalink
Skip eager_workflow test if the server doesn't support it on the Se…
Browse files Browse the repository at this point in the history
…rverCapabilities level
  • Loading branch information
roxblnfk committed Oct 23, 2024
1 parent 0628cad commit de97b45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion features/eager_workflow/successful_start/feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function pipelineProvider(): PipelineProvider

#[Check]
public function check(
#[Stub('Workflow', eagerStart: true, )]
#[Stub('Workflow', eagerStart: true)]
#[Client(timeout:30, pipelineProvider: [FeatureChecker::class, 'pipelineProvider'])]
WorkflowStubInterface $stub,
): void {
Expand Down
8 changes: 8 additions & 0 deletions harness/php/src/Feature/WorkflowStubInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Harness\Feature;

use Harness\Attribute\Stub;
use Harness\Exception\SkipTest;
use Harness\Runtime\Feature;
use Psr\Container\ContainerInterface;
use Spiral\Core\Attribute\Proxy;
Expand Down Expand Up @@ -39,6 +40,13 @@ public function createInjection(

$client = $this->clientFactory->workflowClient($context);

if ($attribute->eagerStart) {
// If the server does not support eager start, skip the test
$client->getServiceClient()->getServerCapabilities()->eagerWorkflowStart or throw new SkipTest(
'Eager workflow start is not supported by the server.'
);
}

/** @var Feature $feature */
$feature = $this->container->get(Feature::class);
$options = WorkflowOptions::new()
Expand Down

0 comments on commit de97b45

Please sign in to comment.