-
Notifications
You must be signed in to change notification settings - Fork 131
Complete PHPUnit infrastructure for out-of-the-box local and CI testing, including initial tests #29
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
Conversation
…dencies are installed before testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixarntz I've tested this, and it looks good overall.
Just added a little comment about the documentation.
@@ -1,3 +1,13 @@ | |||
# WordPress Performance | |||
|
|||
Monorepo for the [WordPress Performance Group](https://make.wordpress.org/core/tag/performance/), primarily for the overall performance plugin, which is a collection of standalone performance modules. | |||
|
|||
## Useful commands | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it makes sense to mention we need to have Docker up and running before running the wp-env
commands. And/or link to the handbook (https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to that, for someone without Docker this npm run wp-env start
and everything after fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, I added a note about both Node.js and Docker being required.
@felixarntz when I tried running Apparently my current npm version of For what its worth, I get a similar error (not warning) when I try to do npm install in the gutenberg repo: |
@felixarntz - this looks great! I left a few questions. I was able to run the tests locally without docker by setting |
@JustinyAhin @ThierryA @adamsilverstein Updated based on your feedback!
Yes, this is intended. The NPM commands (outlined in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
This PR completes the PHPUnit infrastructure so that the repository allows to easily run PHPUnit tests locally in a centralized environment. It also includes a GitHub action to ensure PHPUnit tests run as CI.
The implementation here is pretty much copied over from Gutenberg, reusing the
@wordpress/env
package, which allows us to keep the code here simple.In detail, this PR includes:
package.json
file to include@wordpress/env
dependency and PHP linting/testing scriptsphp-test.yml
to run the above tests automatically on push and PR mergeload.php
(which is all PHP code that exists so far)Please see the
README.md
additions for which commands to use locally to run PHP linting and testing.Fixes #28