-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add a local environment for testing purposes #76
Conversation
… running phpunit.
…re install. Replace it with a hook to `wp_install` instead.
I'm not a super-fan of how the I'm not a fan of Either way, this works, and allows unit testing to be run via GitHub actions without requiring a local WordPress install with all the various functionalities setup |
I get this after pulling #71 and trying to install locally:
|
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.
LGTM 👍🏻
run: npm run env start --xdebug=coverage | ||
|
||
- name: Test | ||
run: npm run test |
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.
It'd be nice to also run the JS unit tests in settings/
, but that might be better scoped for a separate issue, since we might need/want to combine the two package.json
files, or introduce yarn
, etc. LMK what you think and I can open a separate issue for that if desired.
@@ -0,0 +1,46 @@ | |||
<?php | |||
|
|||
// Mimic w.org for testing wporg-two-factor |
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.
It'd be good to remove all this from the README
now that it's automated, and add the steps to setup this new env.
I didn't run into any issues, other than a version issue with npm: I agree that we should reorder the project dependencies to be like others and use yarn workspaces. Should be pretty trivial. |
I merged this to make it easier to contribute. There are a few improvements mentioned that are left hanging. I'll try to follow up. |
This is an initial start at making this self-contained so that test can be run locally without depending on the host system having WP/phpunit configured.
To install:
npm install
To run (This is done as part of the install process)?
npm env start
To run tests:
npm test
See #75