Files
coolify/tests/Unit/StartSentinelEndpointFallbackTest.php
T
Andras Bacsai 16b092336e feat(sentinel): track synchronization state and refresh status UI
Add sentinel waiting-state tracking, synchronization broadcasts, and restore
status handling across server and application interfaces.
2026-09-16 12:51:27 +02:00

34 lines
1.6 KiB
PHP

<?php
test('sentinel startup regenerates an empty endpoint from instance settings', function () {
$action = file_get_contents(dirname(__DIR__, 2).'/app/Actions/Server/StartSentinel.php');
$component = file_get_contents(dirname(__DIR__, 2).'/app/Livewire/Server/Sentinel.php');
expect($action)
->toContain('ensureSentinelUrl()')
->and($component)
->toContain('$this->sentinelCustomUrl = $this->server->settings->sentinel_custom_url;')
->and(file_get_contents(dirname(__DIR__, 2).'/app/Models/ServerSetting.php'))
->toContain('generateSentinelUrl(ignoreEvent: true)')
->toContain('sentinelUrlFromCurrentRequest()')
->toContain('Set an instance FQDN, public IP, or reachable Coolify URL before enabling Sentinel.')
->and($component)
->toContain('$this->sentinelCustomUrl = $this->server->settings->sentinel_custom_url;');
});
test('sentinel startup allows legacy metrics migrations to finish before health checks fail', function () {
$action = file_get_contents(dirname(__DIR__, 2).'/app/Actions/Server/StartSentinel.php');
expect($action)->toContain('--health-start-period 120s');
});
test('local sentinel joins the Coolify network and waits for an authenticated push before becoming live', function () {
$action = file_get_contents(dirname(__DIR__, 2).'/app/Actions/Server/StartSentinel.php');
expect($action)
->toContain('--network coolify')
->toContain('sentinelHeartbeat(isReset: true)')
->toContain("sentinel_waiting_since' => now()")
->not->toContain('$server->sentinelHeartbeat();');
});