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
6 changes: 2 additions & 4 deletions tests/Feature/DeleteSnapshotActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
use DurableWorkflow\AI\Tests\Fakes\Rc1SandboxProvider;
use DurableWorkflow\AI\Tests\Fakes\StubSandboxProvider;
use DurableWorkflow\AI\Tests\TestCase;
use Workflow\V2\Models\ActivityExecution;
use Workflow\V2\Models\WorkflowRun;
use Workflow\V2\Support\ActivityRetryPolicy;

final class DeleteSnapshotActivityTest extends TestCase
Expand All @@ -24,7 +22,7 @@ public function test_deletion_is_idempotent_and_retries_without_a_finite_cleanup
'stub',
static fn ($container, array $config): StubSandboxProvider => $provider,
);
$activity = new DeleteSnapshotActivity(new ActivityExecution, new WorkflowRun);
$activity = new DeleteSnapshotActivity;

$activity->handle('snapshot-1', 'stub');
$activity->handle('snapshot-1', 'stub');
Expand All @@ -44,7 +42,7 @@ public function test_an_rc1_shaped_provider_loads_and_fails_at_capability_negoti
static fn ($container, array $config): Rc1SandboxProvider => $provider,
);

$activity = new DeleteSnapshotActivity(new ActivityExecution, new WorkflowRun);
$activity = new DeleteSnapshotActivity;

$this->expectException(UnsupportedSandboxCapabilityException::class);
$this->expectExceptionMessage('does not support [snapshot_deletion]; the operation was not attempted');
Expand Down
6 changes: 2 additions & 4 deletions tests/Feature/InjectSandboxLossActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
use DurableWorkflow\AI\Tests\Fakes\StubSandboxProvider;
use DurableWorkflow\AI\Tests\TestCase;
use Workflow\Exceptions\NonRetryableException;
use Workflow\V2\Models\ActivityExecution;
use Workflow\V2\Models\WorkflowRun;
use Workflow\V2\Support\ActivityRetryPolicy;

final class InjectSandboxLossActivityTest extends TestCase
Expand All @@ -23,7 +21,7 @@ public function test_retried_injection_reuses_the_identity_and_idempotent_local_
'local',
static fn ($container, array $config): StubSandboxProvider => $provider,
);
$activity = new InjectSandboxLossActivity(new ActivityExecution, new WorkflowRun);
$activity = new InjectSandboxLossActivity;
$handle = (new SandboxHandle('sandbox-1', 'local'))->toArray();

$first = $activity->handle($handle, 'loss-injection-operation-1');
Expand All @@ -37,7 +35,7 @@ public function test_retried_injection_reuses_the_identity_and_idempotent_local_

public function test_injection_rejects_non_local_providers_before_destroy(): void
{
$activity = new InjectSandboxLossActivity(new ActivityExecution, new WorkflowRun);
$activity = new InjectSandboxLossActivity;

$this->expectException(NonRetryableException::class);
$this->expectExceptionMessage('requires the [local] provider; [e2b] was selected');
Expand Down
4 changes: 1 addition & 3 deletions tests/Feature/ProvisionSandboxActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
use InvalidArgumentException;
use RuntimeException;
use Workflow\Exceptions\NonRetryableException;
use Workflow\V2\Models\ActivityExecution;
use Workflow\V2\Models\WorkflowRun;

final class ProvisionSandboxActivityTest extends TestCase
{
Expand Down Expand Up @@ -167,7 +165,7 @@ private function configureE2b(string $apiKey = 'e2b-test-key'): void

private function activity(): ProvisionSandboxActivity
{
return new ProvisionSandboxActivity(new ActivityExecution, new WorkflowRun);
return new ProvisionSandboxActivity;
}

private function extendManager(string $name, StubSandboxProvider $provider): void
Expand Down
6 changes: 2 additions & 4 deletions tests/Feature/RestoreSandboxActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
use DurableWorkflow\AI\Tests\Fakes\StubSandboxProvider;
use DurableWorkflow\AI\Tests\TestCase;
use RuntimeException;
use Workflow\V2\Models\ActivityExecution;
use Workflow\V2\Models\WorkflowRun;

final class RestoreSandboxActivityTest extends TestCase
{
Expand All @@ -25,7 +23,7 @@ public function test_failed_initial_lease_renewal_destroys_the_restored_handle_w
'stub',
static fn ($container, array $config): StubSandboxProvider => $provider,
);
$activity = new RestoreSandboxActivity(new ActivityExecution, new WorkflowRun);
$activity = new RestoreSandboxActivity;

try {
$activity->handle('snapshot-1', 'stub');
Expand All @@ -48,7 +46,7 @@ public function test_provider_handle_name_mismatch_is_cleaned_up_and_nonretryabl
'selected',
static fn ($container, array $config): StubSandboxProvider => $provider,
);
$activity = new RestoreSandboxActivity(new ActivityExecution, new WorkflowRun);
$activity = new RestoreSandboxActivity;

try {
$activity->handle('snapshot-1', 'selected');
Expand Down
4 changes: 1 addition & 3 deletions tests/Feature/SnapshotSandboxActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
use DurableWorkflow\AI\SandboxHandle;
use DurableWorkflow\AI\Tests\Fakes\StubSandboxProvider;
use DurableWorkflow\AI\Tests\TestCase;
use Workflow\V2\Models\ActivityExecution;
use Workflow\V2\Models\WorkflowRun;

final class SnapshotSandboxActivityTest extends TestCase
{
Expand All @@ -21,7 +19,7 @@ public function test_snapshot_operation_identity_reaches_a_reconciling_provider(
'stub',
static fn ($container, array $config): StubSandboxProvider => $provider,
);
$activity = new SnapshotSandboxActivity(new ActivityExecution, new WorkflowRun);
$activity = new SnapshotSandboxActivity;

$snapshot = $activity->handle(
(new SandboxHandle('sandbox-1', 'stub'))->toArray(),
Expand Down