Skip to content

fix(env): honor testsEnvironment default of false - #84711

Open
Hug0-Drelon wants to merge 2 commits into
WordPress:trunkfrom
Hug0-Drelon:fix-wp-env-tests-environment-default
Open

Hug0-Drelon wants to merge 2 commits into
WordPress:trunkfrom
Hug0-Drelon:fix-wp-env-tests-environment-default

Conversation

@Hug0-Drelon

Copy link
Copy Markdown
Contributor

What?

Aligns wp-env runtime behavior with the documented testsEnvironment default of false.

Why?

Fixes #84710. The README and JSON schema document testsEnvironment as defaulting to false, but the code treated an omitted value as true, starting the legacy tests stack (tests-wordpress, tests-cli, port 8889, etc.) and showing a deprecation warning — even when using --config with a dedicated test config file.

How?

  • Default testsEnvironment to false in config parsing.
  • Enable the legacy tests stack only when testsEnvironment is explicitly true.
  • Show the deprecation warning only when the legacy dual-environment mode is opted in (not when using --config).
  • Update tests and the wp-env.json schema default.

Test plan

  • npm run test:unit:vitest -- packages/env
  • wp-env start with a minimal .wp-env.json (no testsEnvironment) starts only the development environment — no tests-* containers, no deprecation warning.
  • wp-env start --config .wp-env.test.json starts a single environment with no deprecation warning.
  • "testsEnvironment": true still starts both environments (with deprecation warning on the default config).

Made with Cursor

Align wp-env runtime behavior with the documented default so omitting
testsEnvironment no longer starts the legacy tests stack or shows a
deprecation warning when using --config.

Fixes WordPress#84710

Co-authored-by: Cursor <cursoragent@cursor.com>
@Hug0-Drelon
Hug0-Drelon requested a review from t-hamano as a code owner October 14, 2026 15:09
@github-actions github-actions Bot added the [Tool] Env /packages/env label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Hug0-Drelon <hugod@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] Env /packages/env

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wp-env doesn't honor testsEnvironment default value.

1 participant