fix: optimize queries and caching for projects and environments

This commit is contained in:
Andras Bacsai
2026-01-16 11:51:26 +01:00
parent 51301fd12e
commit 95091e918f
9 changed files with 203 additions and 35 deletions

View File

@@ -1,5 +1,8 @@
<?php
use App\Models\Server;
use Illuminate\Support\Once;
/*
|--------------------------------------------------------------------------
| Test Case
@@ -12,6 +15,22 @@
*/
uses(Tests\TestCase::class)->in('Feature');
/*
|--------------------------------------------------------------------------
| Test Hooks
|--------------------------------------------------------------------------
|
| Global hooks that run before/after each test.
|
*/
beforeEach(function () {
// Flush the Once memoization cache to ensure tests get fresh data
Once::flush();
// Flush the Server identity map cache to ensure tests get fresh data
Server::flushIdentityMap();
});
/*
|--------------------------------------------------------------------------
| Expectations