Files
coolify/tests/Feature/CheckForUpdatesTraefikTest.php
T
peaklabs-dev 0e30950793 feat(release): streamline versions.json on the CDN
- Every channel has a block of its own, every version after this one reads only these blocks
- Every stable sync also fills the coolify and traefik keys older instances read
- An instance keeps a copy of versions.json and reads upstream.json of the image until it has one
2026-11-02 00:07:20 +01:00

36 lines
989 B
PHP

<?php
use App\Jobs\CheckForUpdatesJob;
use App\Jobs\CheckTraefikVersionJob;
use App\Models\InstanceSettings;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Http;
uses(RefreshDatabase::class);
afterEach(function () {
@unlink(storage_path('app/versions.json'));
});
it('checks installed Traefik versions after refreshing available versions', function () {
Bus::fake();
Http::fake([
'*' => Http::response([
'stable' => ['coolify' => ['version' => '4.0.10'], 'traefik' => ['v3.7' => '3.7.13']],
]),
]);
InstanceSettings::forceCreate(['id' => 0]);
config([
'app.env' => 'production',
'constants.coolify.self_hosted' => true,
'constants.coolify.version' => '4.0.10',
]);
(new CheckForUpdatesJob)->handle();
Bus::assertDispatched(CheckTraefikVersionJob::class);
expect(get_traefik_versions())->toBe(['v3.7' => '3.7.13']);
});