mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 02:16:43 +00:00
fix(storage): split S3 endpoint input and persist stopped status
Persist exited status across application, database, service, and preview stop paths, and reuse the split host/port/path input for S3 endpoints with linked validation feedback.
This commit is contained in:
1 parent
ec8a24d178
commit
2677e47138
12 files changed
+132
-30
No files matched your search
@@ -5,14 +5,18 @@ use Tests\TestCase;
|
||||
|
||||
uses(TestCase::class);
|
||||
|
||||
it('normalizes S3 endpoints without a Livewire blur request', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/storage/create.blade.php'));
|
||||
it('uses the shared split URL input without a Livewire blur request', function () {
|
||||
$createView = file_get_contents(resource_path('views/livewire/storage/create.blade.php'));
|
||||
$editView = file_get_contents(resource_path('views/livewire/storage/form.blade.php'));
|
||||
|
||||
expect($view)
|
||||
expect($createView)
|
||||
->not->toContain('wire:model.blur="endpoint"')
|
||||
->toContain('x-on:blur')
|
||||
->toContain('const hasScheme')
|
||||
->toContain('dispatchEvent');
|
||||
->toContain('<x-forms.domain-input id="endpoint"')
|
||||
->toContain('host-label="Host"')
|
||||
->toContain('host-placeholder="minio.internal or 192.168.1.50"')
|
||||
->and($editView)
|
||||
->toContain('<x-forms.domain-input id="endpoint"')
|
||||
->toContain('@can(\'update\', $storage)');
|
||||
});
|
||||
|
||||
it('normalizes endpoints again on the backend', function (string $endpoint, string $expected) {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
it('persists exited status when stopping standalone databases', function () {
|
||||
$action = file_get_contents(__DIR__.'/../../app/Actions/Database/StopDatabase.php');
|
||||
|
||||
expect($action)->toContain("'status' => 'exited'");
|
||||
});
|
||||
|
||||
it('persists exited status for every full application stop path', function () {
|
||||
$action = file_get_contents(__DIR__.'/../../app/Actions/Application/StopApplication.php');
|
||||
|
||||
expect($action)
|
||||
->toContain("\$status = ['status' => 'exited'];")
|
||||
->toContain('$application->update($status);')
|
||||
->not->toMatch('/docker stack rm .*?return;/s');
|
||||
});
|
||||
|
||||
it('persists exited status for all children when stopping a service', function () {
|
||||
$action = file_get_contents(__DIR__.'/../../app/Actions/Service/StopService.php');
|
||||
|
||||
expect($action)
|
||||
->toContain("\$applications->each->update(['status' => 'exited']);")
|
||||
->toContain("\$dbs->each->update(['status' => 'exited']);");
|
||||
});
|
||||
|
||||
it('persists exited status when stopping an individual service resource', function () {
|
||||
$action = file_get_contents(__DIR__.'/../../app/Actions/Service/StopServiceApplication.php');
|
||||
|
||||
expect($action)
|
||||
->toContain("\$serviceApplication->update(['status' => 'exited']);")
|
||||
->toContain('ServiceStatusChanged::dispatch($service->environment->project->team->id);');
|
||||
});
|
||||
|
||||
it('persists exited status when stopping a preview deployment', function () {
|
||||
$component = file_get_contents(__DIR__.'/../../app/Livewire/Project/Application/Previews.php');
|
||||
|
||||
expect($component)
|
||||
->toContain("->update(['status' => 'exited']);")
|
||||
->toContain('ServiceStatusChanged::dispatch($this->application->environment->project->team->id);');
|
||||
});
|
||||
Reference in new issue
Block a user