Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/conformance/child-workflows-runtime-probe.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,21 @@ function cw_require_child_event(array $history, string $eventType, string $child
throw new RuntimeException(sprintf('%s did not reference child run %s', $eventType, $childRunId));
}

/** @return array<string, array{supported: bool, minimum_protocol_version: string, reason: string}> */
function cw_capability_manifest(): array
{
return array_fill_keys(WorkerProtocol::PORTABLE_WORKER_AFFINITY_CAPABILITIES, [
'supported' => false,
'minimum_protocol_version' => WorkerProtocol::PORTABLE_WORKER_AFFINITY_MINIMUM_PROTOCOL_VERSION,
'reason' => 'not_implemented',
]);
}

/** @param list<string> $types */
function cw_register(string $workerId, string $queue, string $runtime, array $types): void
{
cw_request('POST', '/worker/register', [
'capability_manifest' => cw_capability_manifest(),
'worker_id' => $workerId,
'task_queue' => $queue,
'runtime' => $runtime === 'workflow-php' ? 'php' : 'python',
Expand Down
8 changes: 8 additions & 0 deletions tests/Unit/ChildWorkflowRuntimeContractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ public function test_published_artifact_runner_routes_every_unexecuted_child_wor
$this->assertStringContainsString('output_sample', $installProbe);
$this->assertStringContainsString('WorkflowFiberRunner::forClass(', $runtimeProbe);
$this->assertStringContainsString('cw_failure_cell(', $runtimeProbe);
$this->assertStringContainsString(
"'capability_manifest' => cw_capability_manifest(),",
$runtimeProbe,
);
$this->assertStringContainsString(
'WorkerProtocol::PORTABLE_WORKER_AFFINITY_CAPABILITIES',
$runtimeProbe,
);
$this->assertStringContainsString(
'$parentRuntimeResult = $parentResume[\'observation\'][\'runtime_result\'] ?? null;',
$runtimeProbe,
Expand Down