mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
- Add a hint to failed command messages when the exit code is 255, which explains that the SSH connection to the server closed before the command finished. - Return no services from applicationParser and serviceParser when the compose `services` key is empty or is not a map, so parsing does not fail. - Move Server::getIp() out of the sshEndpointInUse() docblock, where it was misplaced and broke the class. - Add tests for the SSH hint, for services keys that are not maps, and for saved compose variable values that must survive a redeploy (#6995).
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Models\Environment;
|
|
use App\Models\Project;
|
|
use App\Models\Server;
|
|
use App\Models\Service;
|
|
use App\Models\StandaloneDocker;
|
|
use App\Models\Team;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\Bus;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
it('returns no services when the services key of a service stack is not a map', function (string $compose) {
|
|
Bus::fake();
|
|
$team = Team::factory()->create();
|
|
$server = Server::factory()->create(['team_id' => $team->id]);
|
|
$destination = StandaloneDocker::where('server_id', $server->id)->firstOrFail();
|
|
$project = Project::factory()->create(['team_id' => $team->id]);
|
|
$environment = Environment::factory()->create(['project_id' => $project->id]);
|
|
|
|
$service = Service::factory()->create([
|
|
'docker_compose_raw' => $compose,
|
|
'environment_id' => $environment->id,
|
|
'server_id' => $server->id,
|
|
'destination_id' => $destination->id,
|
|
'destination_type' => $destination->getMorphClass(),
|
|
]);
|
|
|
|
expect(serviceParser($service))->toBeEmpty();
|
|
})->with([
|
|
'no value' => "services:\n",
|
|
'a string' => "services: web\n",
|
|
]);
|