From 60a7f0d6fc1e2547da24c6edb437fe9e0da94b07 Mon Sep 17 00:00:00 2001 From: Darko Gjorgjijoski Date: Fri, 5 Jun 2026 08:39:28 +0200 Subject: [PATCH] test: provision modules_statuses.json in the test bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Modules/HelloWorld integration test needs the module enabled at the nwidart level, read from storage/app/modules_statuses.json at app boot. That file is gitignored (created locally by `module:make`), so it's absent on CI and fresh clones — HelloWorld stays disabled and the 5 integration tests fail with 404s. Provision it (only if missing) in tests/Pest.php before any test boots the app, so CI matches a local dev environment. Full suite: 462 pass. --- tests/Pest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Pest.php b/tests/Pest.php index 3260e4c6..34124006 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -3,5 +3,17 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; +// The Modules/HelloWorld integration test needs the module enabled at the +// nwidart level, which is read from storage/app/modules_statuses.json when the +// app boots. That file is gitignored (created locally by `module:make`), so it +// is absent in CI and fresh clones — leaving HelloWorld disabled and the +// integration test failing with 404s. Provision it (only if missing) before any +// test boots the application, so CI matches a local dev environment. +$modulesStatuses = __DIR__.'/../storage/app/modules_statuses.json'; +if (! is_file($modulesStatuses)) { + @mkdir(dirname($modulesStatuses), 0755, true); + file_put_contents($modulesStatuses, json_encode(['HelloWorld' => true], JSON_PRETTY_PRINT).PHP_EOL); +} + uses(TestCase::class, RefreshDatabase::class)->in('Feature'); uses(TestCase::class, RefreshDatabase::class)->in('Unit');