Skip to content

Wire PHPUnit suites into CI with a real WordPress test environment - #7

Merged
miguelcolmenares merged 1 commit into
mainfrom
feature/wire-phpunit-into-ci
Aug 18, 2026
Merged

Wire PHPUnit suites into CI with a real WordPress test environment#7
miguelcolmenares merged 1 commit into
mainfrom
feature/wire-phpunit-into-ci

Conversation

@miguelcolmenares

Copy link
Copy Markdown
Member

Summary

  • Adds a MySQL 8.0 service to the CI matrix and a new "Run PHPUnit" step that installs the shared WordPress test suite + WPGraphQL and runs all 3 sub-plugins' PHPUnit suites (from Add PHPUnit unit + integration test suites to all sub-plugins #6), instead of stopping at PHPCS/PHPStan/build.
  • Adds install-wp-test-env, phpunit, and test-integration Makefile targets, reusing the exit-code-propagation pattern already established for phpcs/phpstan/install/build (Fix silently-swallowed CI failures + resolve pre-existing PHPStan errors #4).
  • Fixes two bugs surfaced while validating this locally:
    • An unquoted $(DB_PASS) in the Makefile's installer call silently shifted every positional argument to install-wp-tests.sh whenever the password was empty.
    • install-wpgraphql-for-tests.sh's reinstall prompt (read -p ...) hit EOF and killed the script under set -e whenever stdin had no TTY and no CI flag (FORCE_GRAPHQL_REINSTALL/CI/GITHUB_ACTIONS/CONTINUOUS_INTEGRATION) was set — e.g. every local make install-wp-test-env re-run.
  • Updates README.md/CONTRIBUTING.md testing instructions to reference the new Makefile targets instead of the old manual script invocations.

Changes Made

  • .github/workflows/ci.yml: MySQL service, subversion/mysqli/pdo_mysql deps, new "Run PHPUnit" step.
  • Makefile: new DB_*/WP_VERSION variables, exported fixed WP_TESTS_DIR/WP_CORE_DIR defaults (not $TMPDIR-derived, so all 3 sub-plugins' test scripts agree across platforms), 3 new targets.
  • scripts/install-wpgraphql-for-tests.sh: TTY-guarded reinstall prompt.
  • README.md, CONTRIBUTING.md: updated testing instructions.

Testing

  • Verified locally end-to-end: make test-integration DB_PASS='' runs install-dev → WP test suite install → WPGraphQL install → PHPUnit for all 3 sub-plugins — all 148 tests pass.
  • Ran a core-review pass (--budget medium) before opening this PR; found and fixed 2 stale-doc findings (README/CONTRIBUTING referencing the old manual commands), re-reviewed to confirm convergence.

Checklist

  • Self-review completed
  • Tests pass locally (148/148, all 3 sub-plugins)
  • Documentation updated

Adds a MySQL service to the CI matrix and a "Run PHPUnit" step that
installs the shared WP test suite + WPGraphQL and runs all 3 sub-plugins'
suites, instead of stopping at PHPCS/PHPStan/build as before.

New Makefile targets (install-wp-test-env, phpunit, test-integration)
reuse the exit-code-propagation pattern already established for
phpcs/phpstan/install/build. Fixed two bugs surfaced while wiring this up
locally: an unquoted $(DB_PASS) in the installer call silently shifted
every positional argument when the password was empty, and
install-wpgraphql-for-tests.sh's reinstall prompt hit EOF and killed the
script under set -e whenever stdin had no TTY and no CI flag was set.
@miguelcolmenares
miguelcolmenares merged commit 7d62027 into main Aug 18, 2026
3 checks passed
@miguelcolmenares
miguelcolmenares deleted the feature/wire-phpunit-into-ci branch August 18, 2026 12:30
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.

1 participant