Skip to content

Test wildcard environments config #1465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 17, 2024
Merged
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
26 changes: 26 additions & 0 deletions tests/Feature/ProvisioningPlanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,32 @@ public function test_supervisors_are_added_by_wildcard()
$this->assertSame(20, $command->options['maxProcesses']);
}

public function test_supervisors_are_added_as_fallback_for_wildcard_environments()
{
$plan = [
'*' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => 'first',
'max_processes' => 10,
],
],
];

$plan = new ProvisioningPlan(MasterSupervisor::name(), $plan);
$plan->deploy('develop');

$commands = Redis::connection('horizon')->lrange(
'commands:'.MasterSupervisor::commandQueueFor(MasterSupervisor::name()), 0, -1
);

$this->assertCount(1, $commands);
$command = (object) json_decode($commands[0], true);
$this->assertSame(AddSupervisor::class, $command->command);
$this->assertSame('first', $command->options['queue']);
$this->assertSame(10, $command->options['maxProcesses']);
}

public function test_plan_is_converted_into_array_of_supervisor_options()
{
$plan = [
Expand Down