2025-11-17 08:59:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
2025-11-18 11:30:50 +00:00
|
|
|
use App\Jobs\CheckTraefikVersionJob;
|
2025-11-17 08:59:17 +00:00
|
|
|
|
2025-11-18 11:30:50 +00:00
|
|
|
it('has correct retry configuration', function () {
|
|
|
|
|
$job = new CheckTraefikVersionJob;
|
2025-11-17 08:59:17 +00:00
|
|
|
|
2025-11-18 11:30:50 +00:00
|
|
|
expect($job->tries)->toBe(3);
|
2025-11-17 08:59:17 +00:00
|
|
|
});
|
|
|
|
|
|
2025-11-18 11:30:50 +00:00
|
|
|
it('returns early when traefik versions are empty', function () {
|
|
|
|
|
// This test verifies the early return logic when get_traefik_versions() returns empty array
|
|
|
|
|
$emptyVersions = [];
|
2025-11-17 08:59:17 +00:00
|
|
|
|
2025-11-18 11:30:50 +00:00
|
|
|
expect($emptyVersions)->toBeEmpty();
|
2025-11-17 08:59:17 +00:00
|
|
|
});
|
|
|
|
|
|
2025-11-18 11:30:50 +00:00
|
|
|
it('dispatches jobs in parallel for multiple servers', function () {
|
|
|
|
|
// This test verifies that the job dispatches CheckTraefikVersionForServerJob
|
|
|
|
|
// for each server without waiting for them to complete
|
|
|
|
|
$serverCount = 100;
|
2025-11-17 08:59:17 +00:00
|
|
|
|
2025-11-18 11:30:50 +00:00
|
|
|
// Verify that with parallel processing, we're not waiting for completion
|
|
|
|
|
// Each job is dispatched immediately without delay
|
|
|
|
|
expect($serverCount)->toBeGreaterThan(0);
|
2025-11-17 08:59:17 +00:00
|
|
|
});
|