-
Notifications
You must be signed in to change notification settings - Fork 41
Docs: Update testing guide to use wp-env workflow #67
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
…nd wp-env instructions - Added a "Contributing" section to the README with a link to the Testing Guide. - Revised the Testing Guide to emphasize the use of `wp-env` for running and writing tests, including detailed instructions for starting the test environment and running tests in both unit and integration modes. - Enhanced coverage reporting instructions and clarified prerequisites for testing.
…ation instructions - Updated the "Class not found" section to clarify common causes and provide a specific command for regenerating the Composer autoloader. - Added explanation of the `--env-cwd` flag to ensure proper working directory configuration within the Docker container.
…ink to the Testing Guide for comprehensive details
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.
Pull Request Overview
This PR updates the testing documentation to reflect the current wp-env-based workflow and improves discoverability of testing resources. The changes align the documentation with the actual implementation introduced in PR #18, replacing outdated manual setup instructions with the containerized approach.
Key changes:
- Replaced manual database/Composer testing workflow with wp-env commands
- Made testing guide discoverable through main documentation index and CONTRIBUTING.md
- Updated test coverage commands, fixture documentation, and CI/CD information to match actual implementation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/guides/testing.md | Complete rewrite replacing manual setup with wp-env workflow, updated commands, fixture docs, and CI details |
| docs/README.md | Added "Contributing" section linking to CONTRIBUTING.md and testing.md for better discoverability |
| CONTRIBUTING.md | Replaced duplicated testing instructions with link to comprehensive Testing Guide |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Mostly good, @galatanovidiu! Just one section that I'm wondering about.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #67 +/- ##
=========================================
Coverage 68.94% 68.94%
Complexity 821 821
=========================================
Files 46 46
Lines 3037 3037
=========================================
Hits 2094 2094
Misses 943 943
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Why
Issue #19 identified that the
testing.mddocumentation was outdated and didn't reflect the current wp-env-based testing workflow introduced in PR #18. The documentation still referenced manual database setup and Composer commands that are no longer the recommended approach for running tests.Additionally, the testing guide was not discoverable - it wasn't linked from the main documentation index (
docs/README.md) or referenced fromCONTRIBUTING.md, making it difficult for contributors to find.What
Updated
docs/guides/testing.mdnpm run test:phpwith argument passing via--npm run wp-env start -- --xdebug=coverage)record_event(), notincrement()/timing())tests/_output/html/index.html)composer dump-autoloadMade testing guide discoverable
docs/README.mdlinking to bothCONTRIBUTING.mdandtesting.mdCONTRIBUTING.mdto link to comprehensive Testing Guide instead of duplicating instructionsVerified accuracy
.github/workflows/test.ymlTesting
All commands in the updated documentation have been tested and verified to work:
npm run test:php(all 357 tests pass)npm run test:php -- --filter test_namenpm run test:php -- tests/Unit/Handlers/ToolsHandlerCallTest.phpnpm run wp-env start -- --xdebug=coverageCloses #19