Skip to content

Add wp-env for local WordFence test environment#1209

Draft
jkmassel wants to merge 4 commits intotrunkfrom
jkmassel/add-wp-env
Draft

Add wp-env for local WordFence test environment#1209
jkmassel wants to merge 4 commits intotrunkfrom
jkmassel/add-wp-env

Conversation

@jkmassel
Copy link
Contributor

Summary

  • Introduce wp-env infrastructure for running local WordPress test environments with plugins
  • Replace the remote WordFence login test (Spec 8) with a local wp-env instance running the real WordFence plugin
  • Structure supports multiple environments under wp-env/, each with its own port (starting at 4100)

Test plan

  • make wp-env-wordfence-start starts WordPress with WordFence on port 4100
  • cargo test -p wp_api_integration_tests --test test_login_wp_env passes locally
  • CI build passes

🤖 Generated with Claude Code

Replace the remote WordFence login test (Spec 8) with a local wp-env
instance. wp-env manages Docker containers with WordPress + plugins,
making tests self-contained and not dependent on external servers.

The multi-environment structure under wp-env/ supports adding more
configurations (each with its own port starting from 4100).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 27, 2026

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1209")

Built from 3010d0a

jkmassel and others added 3 commits February 27, 2026 16:54
The default queue agents lack OpenSSL dev libraries needed to compile
the Rust test binary. The android queue agents have them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The /wp-json/ pretty permalink path requires Apache mod_rewrite with
AllowOverride, which doesn't work reliably across Docker environments.
Use plain permalinks instead so WordPress serves the REST API via
?rest_route= which works everywhere.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The wp-env test requires a separate wp-env server on localhost:4100 which
isn't available in the Docker-based integration test environment. Mark it
with #[ignore] so it's skipped in regular `cargo test -p wp_api_integration_tests`
runs, and use --include-ignored in the dedicated wp-env CI step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants