wowowowowo
Some checks failed
CI / Lint (push) Failing after 22s
CI / Tests (push) Failing after 33s

This commit is contained in:
2026-05-28 15:15:41 +01:00
parent 8f603122e2
commit 5b977c1f41
129 changed files with 9943 additions and 722 deletions

View File

@@ -9,6 +9,7 @@ use App\Models\Provider;
use App\Models\Server;
use App\Models\Service;
use App\Models\User;
use App\Services\Operations\RemoteCommandRunner;
use Inertia\Testing\AssertableInertia;
it('shows the stateful service update page with backup capability', function () {
@@ -43,6 +44,7 @@ it('stores an explicit stateful update operation', function () {
]), [
'image_digest' => 'sha256:newdigest',
'backup_requested' => true,
'confirmation' => 'postgres',
]);
$response->assertRedirect(route('servers.show', [
@@ -58,6 +60,26 @@ it('stores an explicit stateful update operation', function () {
->and($service->update_status)->toBe('update_pending');
});
it('resolves the latest service image digest from the update page', function () {
app()->instance(RemoteCommandRunner::class, new class implements RemoteCommandRunner
{
public function run(Server $server, string $script): string
{
return "image_digest=postgres:18@sha256:resolveddigest\n";
}
});
[$user, $organisation, $server, $service] = serviceUpdateFixture([
'backup_enabled' => true,
]);
$this->actingAs($user)
->post(route('service-updates.resolve', [$organisation, $server, $service]))
->assertRedirect(route('service-updates.create', [$organisation, $server, $service]));
expect($service->refresh()->available_image_digest)->toBe('sha256:resolveddigest');
});
/**
* @return array{0: User, 1: Organisation, 2: Server, 3: Service}
*/