Conversation
f0f5299 to
49f47e0
Compare
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Copilot. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
49f47e0 to
5b9a7db
Compare
There was a problem hiding this comment.
Pull request overview
Updates the project’s wp-env configuration and documentation to avoid the deprecation warning introduced in @wordpress/env v11+ by separating development and test environment usage.
Changes:
- Add a dedicated
.wp-env.tests.jsonconfig and npm scripts for starting/stopping the test stack. - Update PHP tooling/test scripts to run wp-env commands with an explicit
--config. - Refresh docs/CI triggers to reference the new test config and scripts.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds test stack scripts and updates PHP-related wp-env commands to use --config=.wp-env.tests.json. |
| docs/running-unit-tests.md | Updates local unit test instructions to start the new tests stack script. |
| README.md | Documents separate dev vs test stacks and how to start/stop each. |
| .wp-env.tests.json | Introduces separate wp-env config intended for test runs. |
| .wp-env.json | Updates base wp-env config to include schema and disable tests environment by default. |
| .gitignore | Ignores tests override config file. |
| .github/workflows/php-test.yml | Ensures CI triggers on .wp-env.tests.json changes and starts wp-env with the tests config. |
| .gitattributes | Excludes .wp-env.tests.json from export archives. |
| .distignore | Excludes the new tests config/override from plugin distribution builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.wp-env.json
Outdated
| "$schema": "https://schemas.wp.org/trunk/wp-env.json", | ||
| "core": null, | ||
| "plugins": [ "." ], | ||
| "testsEnvironment": false |
There was a problem hiding this comment.
.wp-env.json uses tab indentation, but .editorconfig specifies indent_style = space and indent_size = 2 for *.json. Please reformat this JSON to match the repository’s formatting rules to avoid churn in future diffs.
| "$schema": "https://schemas.wp.org/trunk/wp-env.json", | |
| "core": null, | |
| "plugins": [ "." ], | |
| "testsEnvironment": false | |
| "$schema": "https://schemas.wp.org/trunk/wp-env.json", | |
| "core": null, | |
| "plugins": [ "." ], | |
| "testsEnvironment": false |
.wp-env.tests.json
Outdated
| "$schema": "https://schemas.wp.org/trunk/wp-env.json", | ||
| "core": null, | ||
| "plugins": [ "." ], | ||
| "testsEnvironment": false, | ||
| "phpVersion": "7.4", | ||
| "port": 8889 |
There was a problem hiding this comment.
.wp-env.tests.json uses tab indentation, but .editorconfig enforces 2-space indentation for *.json. Please reformat this file accordingly to keep JSON formatting consistent across the repo.
| "$schema": "https://schemas.wp.org/trunk/wp-env.json", | |
| "core": null, | |
| "plugins": [ "." ], | |
| "testsEnvironment": false, | |
| "phpVersion": "7.4", | |
| "port": 8889 | |
| "$schema": "https://schemas.wp.org/trunk/wp-env.json", | |
| "core": null, | |
| "plugins": [ "." ], | |
| "testsEnvironment": false, | |
| "phpVersion": "7.4", | |
| "port": 8889 |
.wp-env.tests.json
Outdated
| "$schema": "https://schemas.wp.org/trunk/wp-env.json", | ||
| "core": null, | ||
| "plugins": [ "." ], | ||
| "testsEnvironment": false, |
There was a problem hiding this comment.
The new .wp-env.tests.json still sets testsEnvironment: false, but the wp-env warning (and issue linked in the PR) indicates testsEnvironment itself is deprecated. If this flag isn’t required for the separate tests config, drop it to avoid relying on an option slated for removal.
| "testsEnvironment": false, |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@ernilambar I've opened a new pull request, #1239, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: ernilambar <2098823+ernilambar@users.noreply.github.com> Agent-Logs-Url: https://github.com/WordPress/plugin-check/sessions/f261ab66-9664-4716-a7ae-56dd8ff24075
Co-authored-by: ernilambar <2098823+ernilambar@users.noreply.github.com> Agent-Logs-Url: https://github.com/WordPress/plugin-check/sessions/f261ab66-9664-4716-a7ae-56dd8ff24075
Fix wp-env deprecation warning: separate dev/test configs and clean up formatting
|
@copilot Tests are failing with following errors: |
Co-authored-by: ernilambar <2098823+ernilambar@users.noreply.github.com> Agent-Logs-Url: https://github.com/WordPress/plugin-check/sessions/7767fe7c-e3cd-4ef7-a2d0-c37fbeab9262
... Fixed in aaa351f. The issue was that wp-env's default |
Fixes #1236
.wp-env.jsonindentation to use 2-space indentation (per.editorconfig).wp-env.tests.jsonindentation to use 2-space indentation (per.editorconfig)testsEnvironment: falsefrom.wp-env.tests.jsontestsEnvironment: falsefrom.wp-env.json.github/workflows/php-test.ymlto use dedicated npm scripts (wp-env:start:tests) instead of hard-coded commandstestsPort: 8890to.wp-env.tests.jsonso dev (8889) and tests (8890) environments don't share the same port✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.