Add Filament admin CRUD tests for all resources and the Settings page - #2564
Conversation
Every admin resource now has create, edit, delete, validation, and
negative-authorization coverage: Servers, Nodes, Users, Eggs, Mounts,
BackupHosts, DatabaseHosts, Roles, Webhooks, and ApiKeys, plus render,
authorization, and save-persistence tests for the Settings page.
Wings calls are mocked through DaemonServerRepository like the existing
service tests, and the database host connection check is faked with a
proxied partial of the database manager so the panel connection stays
real. EnvironmentWriterTrait now resolves the env file through
app()->environmentFilePath() instead of a hardcoded base_path('.env'),
which behaves identically in production and lets the settings test point
writes at a scratch file.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change makes environment writes use the configured application environment path. It adds Filament tests for settings and admin CRUD flows, including validation, persistence, deletion, external-call handling, and permission enforcement. ChangesAdmin panel coverage
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Environment settings now use the configured application environment-file path, while the change adds admin and settings coverage. No concrete merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The custom PHPStan rule forbids the app() global.
Summary
ListNodesTestpattern.EnvironmentWriterTraitnow writes toapp()->environmentFilePath()instead of hardcodedbase_path('.env'), which is identical in production but lets the settings test redirect writes to a scratch file viauseEnvironmentPath().DaemonServerRepository(same pattern asServerCreationServiceTest); the database host connection check is faked with a proxied partial of the database manager so the panel's own connection stays real.Raises
tests/Filamentfrom 43 to 92 tests. Part of the W5 critical-path test coverage work; a follow-up PR covers the Application API endpoints.Test plan
vendor/bin/pest tests/Filament --parallelpasses (92 tests).vendor/bin/pest tests/Integration --parallelstill passes (the trait change is exercised by the installer tests).