-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce plugins
folder for standalone plugins
#934
Comments
@mukeshpanchal27 @joemcgill @swissspidy See #946 (comment): This brought up another thing that needs to be addressed which is the actual test coverage. I wonder how we can address this in the most efficient way. Maybe the test suites could then also set a constant or environment variable which the Not sure whether this makes sense, I'm curious on your feedback or any alternative ideas you may have to make this possible but also keep it as simple as possible. |
Right, with this becoming more like a monorepo of individual plugins we need to run tests and static analysis separately for each plugin. Right now the PHPUnit |
#948 has been merged, still keeping this open for the follow up effort of test setup (see above). |
In #639, we implemented a command to test building the plugin. Could we implement a similar setup, or do you have any other proposed way to handle this? |
@mukeshpanchal27 I don't think we need a new JS script to enable unit testing the standalone plugins, I think it should be possible to accomplish this via using multiple test suites in the For convenience, it would probably help to have a script for this in cc @swissspidy |
Yeah something like that is possible. PHPUnit supports |
@swissspidy When i ran |
Have you tried that in the #544 branch? It requires a change like that to the package.json script to work so the argument is correctly passed to the container. Alternatively just use vendor/bin/phpunit locally for testing. |
Yes. |
If you have a PR that implements the individual testsuites I'm happy to take a look. At first glance it looks like
So the command itself works. But requires #544 and of course the testsuites to be set up. |
POC added in PR #956 |
Close in #956 |
I think I think a cleaner approach can be to include its own PHPUnit config in the plugins and let the main PHPUnit config handle its single responsibility which is unit testing for the main plugin. |
I seem to recall suggesting having a separate Since we're going to have a separate If we do that, it would necessarily mean the bootstrap logic would have to change: instead of looking at the But assuming that the tests all remain in Lines 15 to 17 in d20057d
But since the config is in <testsuite name="auto-sizes">
<directory suffix=".php">../../tests/plugins/auto-sizes</directory>
</testsuite> So instead of it being in the root I think this approach is a bit cleaner, but it seems maintenance is about the same. Perhaps something to file in a new issue? |
Since we are moving toward more of a "monorepo" approach for plugins, I think we should also unify the development for a standalone plugin in its place which will add some more benefits for DX. Currently, if someone working on a plugin, they need to go to the top-level tests directory and find the right place to put the tests in that directory, Rather what we can do is bring the test config and tests directory to the plugin directory so all things related to the single plugin can be handled within it. ping @swissspidy @mukeshpanchal27 @joemcgill for visibility. |
Yeah there are definitely multiple ways to improve DX in this new monorepo structure. Let‘s open a new issue to discuss this properly. |
@swissspidy here we go - #1012 |
This issue is part 1/2 for setting up the new infrastructure for developing standalone plugins.
Requirements
This work should be implemented against a new
feature/modules-to-plugins
feature branch.plugins
folder in the repository root..gitkeep
to it.plugins
folder to be ignored in.gitattributes
so that it won't be part of the Performance Lab plugin build.plugins.json
file:modules
andplugins
.modules
should have the map of "module => plugin data (slug and version)", i.e. the same thing that the file contains today.plugins
should have an array of plugin slugs.plugins.json
file to look for modules within the newmodules
property in the file.plugins
folder in any dev tooling that currently lints/covers themodules
folder (e.g. inphpcs.xml.dist
etc.).Note: Additional changes to build/publish the new plugins should be implemented in a separate follow-up issue.
The text was updated successfully, but these errors were encountered: