Conversation
Establish a WordPress-core full-content style regression net for Gutenberg blocks, verifying block validity and save-output stability before the planned TypeScript/ESM refactor. balloon is the first covered block: each fixture is parsed, asserted valid, and re-serialized to confirm a clean round-trip. Run via @wordpress/scripts test-unit-js. Cocoon-specific global stubs are required because transforms.js and edit.js reference wp.* and gbSettings at module load time; removing that global coupling in the refactor will let the stubs go away.
The integration bootstrap called tests_add_filter() before requiring the WordPress test suite's functions.php that defines it, so it fatally errored the moment it was actually used. The bug stayed hidden because phpunit.xml still wires every suite to the unit bootstrap, leaving this file dead. Require functions.php first so the file works once wired in.
Add the regression matrix ceiling environment for local integration and render testing. Ports, network subnet, and volumes are isolated from the existing 6.x combos so it can run alongside them. A dedicated wordpress_test database is created on init because the WP test suite drops all tables in its target database. Also ignore .phpunit.result.cache.
Add a WordPress-core style render regression test for the dynamic new-list block. Deterministic posts are seeded via the test factory, rendered through do_blocks(), and the volatile parts (ids, dates, urls, version query) are normalized before comparing against a committed golden. Run with UPDATE_GOLDEN=1 to regenerate the golden files.
The integration testsuite silently skipped in CI because phpunit.xml wires every suite to the Brain\Monkey unit bootstrap, which never loads WP_UnitTestCase. Real WordPress integration tests must run on PHPUnit 9.x + yoast/phpunit-polyfills ^1.1, since the WordPress 7.0 test suite calls parseTestMethodAnnotations(), removed in PHPUnit 10; the theme root stays on PHPUnit ^11 for the unit lane. Give the integration lane its own isolated toolchain (a dedicated composer manifest with a tracked lock for reproducibility), a PHPUnit 9.6 config that loads the WP-aware bootstrap, and a docker-based local runner that mirrors the CI path. The bootstrap loads the tooling autoloader rather than the theme's PHPUnit 11 vendor to avoid class-version clashes.
Point the CI integration job at the isolated PHPUnit 9.6 toolchain and the dedicated integration config, and pass the polyfills path to the WP test suite. The job now actually executes the integration tests instead of silently skipping them all.
GitHub is deprecating Node.js 20 on Actions runners, so checkout, cache, and upload-artifact were being force-run on Node 24 with a warning. Bump each to the lowest major that natively targets Node 24 (checkout v5, cache v5, upload-artifact v6 — v5 still ships Node 20) to clear the warning with minimal change; dependabot can advance them further.
phpunit.yml covers only the PHP side; the block JavaScript fixture tests (block.json + edit/save parse-serialize round-trip) had no CI job and ran locally only. Add a Block Regression workflow that installs the blocks toolchain and runs the jest fixture suite, so the JS safety net actually gates on pull requests.
Generalize the balloon proof-of-concept into a block.json discovery harness that registers every structured block (37: block, block-universal, micro) via its index.js metadata instead of the unstable blocks.js path, then runs the WordPress-core full-content round-trip (parse, assert valid, re-serialize) against a captured fixture per block. Fixtures are generated from each block's example via createBlock/getBlockFromExample + serialize, not hand-guessed. Add @wordpress/block-library as a dev dependency (version-matched to the installed @WordPress packages, no drift) so InnerBlocks serialize through the real core blocks. A single console.error suppression is scoped to the core/list unique-key dev warning; every other error still fails the suite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ブロック回帰テスト網の骨格 + integrationレーン実働化。CI検証用のdraft(マージしない)。
このPRの目的は、integrationテストがCIで実際に実行される(skipされない)ことの確認。