mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-14 00:33:44 -04:00
test: remove tests that do not test behavior and strengthen weak ones
- Remove tests that only check markup, CSS, static text, wire:key strings, framework behavior, copied app logic, or expect(true) - Replace source-grep and Reflection checks of security fixes with tests that run the real code (shell quoting, locked properties, 403 checks, webhook fork trust, log redaction, Sentinel token cleanup) - Assert response bodies and unchanged data on API error paths - Run the Traefik version job through handle() instead of private methods - Update stale tests for scheduled task props, the default Postgres image, and the disabled transfer link of unvalidated servers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
de75bbe004
commit
a70e856882
@@ -159,23 +159,6 @@ it('makes network removal idempotent without hiding other failures', function ()
|
||||
rmdir($directory);
|
||||
});
|
||||
|
||||
it('uses idempotent commands in strict cleanup paths', function () {
|
||||
$root = dirname(__DIR__, 2);
|
||||
|
||||
expect(file_get_contents($root.'/app/Jobs/DatabaseBackupJob.php'))
|
||||
->toContain('dockerRemoveCommand("backup-of-{$this->backup_log_uuid}")')
|
||||
->and(file_get_contents($root.'/app/Actions/Database/StopDatabaseProxy.php'))
|
||||
->toContain('dockerRemoveCommand("{$uuid}-proxy")')
|
||||
->and(file_get_contents($root.'/app/Actions/Destination/RemoveStandaloneDockerNetwork.php'))
|
||||
->toContain('dockerNetworkRemoveCommand($destination->network)')
|
||||
->and(file_get_contents($root.'/app/Livewire/Destination/Show.php'))
|
||||
->toContain('dockerNetworkRemoveCommand($this->destination->network)')
|
||||
->and(file_get_contents($root.'/app/Listeners/ProxyStatusChangedNotification.php'))
|
||||
->toContain("dockerRemoveCommand('coolify-proxy')")
|
||||
->and(file_get_contents($root.'/app/Actions/Application/StopApplicationOneServer.php'))
|
||||
->toContain('dockerRemoveCommand($containerName)');
|
||||
});
|
||||
|
||||
it('configures deferred removal attempts to outlive the shell timeout', function () {
|
||||
$job = new RemoveContainerJob(123, 'container-name');
|
||||
|
||||
@@ -184,13 +167,3 @@ it('configures deferred removal attempts to outlive the shell timeout', function
|
||||
->and($job->timeout)->toBeGreaterThan(60)
|
||||
->and($job->tries)->toBeGreaterThan(1);
|
||||
});
|
||||
|
||||
it('continues deployments and schedules deferred cleanup after a removal timeout', function () {
|
||||
$source = file_get_contents(dirname(__DIR__, 2).'/app/Jobs/ApplicationDeploymentJob.php');
|
||||
|
||||
expect($source)
|
||||
->toContain('dockerRemoveCommandWithTimeout($containerName)')
|
||||
->toContain('timed out after 60 seconds. The deployment will continue')
|
||||
->toContain('RemoveContainerJob::dispatch($this->server->id, $containerName)')
|
||||
->toContain('->delay(now()->addMinutes(5))');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user