Repository navigation
Run plugin tests from the plugins' own repositories (shop) - #671
Conversation
phpunit.xml and Pest pick up app/Plugins/*/tests, and Pest loads each plugin's tests/Helpers.php, so the shop plugin's tests and helpers move to its repository. Core keeps the tests of core code, including the template's section types on a domain without the shop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Plugin test discovery and setup _api_app/phpunit.xml, _api_app/tests/Pest.php |
PHPUnit discovers tests under plugin directories and excludes those tests from source coverage. Pest applies its test binding to plugin test directories and loads matching plugin helper files. The shop-specific test setup helpers were removed from Pest. |
Shop feature test changes _api_app/tests/Feature/SectionHeadShopStylesTest.php, _api_app/tests/Feature/ShopCartRenderServiceTest.php, _api_app/tests/Feature/ShopControllerTest.php, _api_app/tests/Feature/ShopInvoiceTest.php, _api_app/tests/Feature/ShopStorefrontControllerTest.php, _api_app/tests/Feature/SiteTemplatesConfigServiceTest.php, _api_app/tests/Feature/SitesDataServiceTest.php |
Five shop-specific feature test files and SitesDataServiceTest.php were deleted. The site template test now checks only that shop and shopping_cart sections are absent on other.test; a comment assigns shop-domain coverage to plugin tests. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Other
Merge Risk: 
Minimal · up to 146a9
-
Shop tests move to the plugin suite. Merge alongside the shop plugin branch and run its tests.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "Run plugin tests from the plugins' own repositories (shop)" matches the main change. The PR moves the shop plugin's Pest tests and helpers out of core into the shop plugin repository. It also adds a Plugins PHPUnit suite and loads each plugin's tests/Helpers.php from tests/Pest.php. The title is specific, short, and free of file lists or vague terms. It does not name the test-discovery configuration, but that is a secondary detail.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
The shop plugin's Pest tests move to its own repository, as the AI assistant plugin's did on
mcp-integration(#668). So the main repository only tests core, and an install without the shop simply has no shop tests instead of skipping them.Companion change in the shop plugin repository (Bitbucket
berta-shop-laravel-plugin), branchshop-tests-in-plugin.Changes
phpunit.xmlhas aPluginssuite forapp/Plugins/*/tests(excluded from the source), andtests/Pest.phpbindsTestCasethere too. These are the same lines as onmcp-integration, so the two branches merge without conflicts there.tests/Pest.phploads each plugin'stests/Helpers.phpwhen it exists. Pest only loads the maintests/Pest.php, so this is how a plugin shares helpers between its tests.ShopControllerTest,ShopStorefrontControllerTest,ShopInvoiceTest,ShopCartRenderServiceTest(and its Pest snapshots),SectionHeadShopStylesTest,SitesDataServiceTest(all about the site's shop files)tests/Pest.php, includingisShopPluginInstalled()andskipWithoutShopPlugin()SiteTemplatesConfigServiceTestkeeps the core case only: no shop section types on a domain without the shop. The case with the shop moved to the plugin.WebAccessRulesTest(the.htaccessrules for_shop_files),SitemapRenderServiceTest,SiteSettingsConfigServiceTest.Merge notes
mcp-integrationchangessetUpShopTestRoot()in coretests/Pest.phpto uselinkBertaEngine(). This branch moves that helper to the plugin'stests/Helpers.php, so whichever merges second needs a small manual merge there (the plugin's copy should calllinkBertaEngine()).Test plan
php artisan test --compact app/Plugins/Shop/tests: 212 passed (the 212 shop tests that core skipped without the plugin)php artisan test --compact --testsuite=Unit,Feature: 111 passed, with and without the shop plugin installed, nothing skipped for the shop🤖 Generated with Claude Code
Summary by CodeRabbit