Fix E2E: wp-env reset on cache-restore fresh DB so GF REST enables#1662
Merged
Conversation
|
Coverage report for commit: 0364c4a Summary - Lines: 92.96% | Methods: 88.24% | Branches: 81.37%
🤖 Jest coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage report for commit: 0364c4a Summary - Lines: 82.18% | Methods: 88.63%
🤖 PHPUnit coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1a0273d to
ba3d0d8
Compare
9cb0a2b to
c8ed016
Compare
…es in E2E When the wp-env work-dir cache is restored against a fresh MySQL volume, a bare `wp core install` leaves the environment half-configured and the gf/v2 REST API never enables, failing every Playwright shard with rest_no_route. Run wp-env's own reset instead, which performs the full install/configure path like a fresh start. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c8ed016 to
0364c4a
Compare
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.
Problem
The Playwright E2E shards fail intermittently with
rest_no_routefor/gf/v2/*— but the pattern is not random. They fail whenever thewp-envwork-directory cache is restored (a cache hit), and pass on a cache miss.The work-dir cache is keyed on
hashFiles('tools/wp-env/e2e.json', 'composer.lock'), but the MySQL volume is not cached. So a restored work-dir pairs with a fresh, empty database. The existing fallback ran a barewp core install, which installs WordPress core but skips wp-env's full configure path — leaving Gravity Forms half-configured. The result: thegravityformsaddon_gravityformswebapi_settingsoption never persists,is_v2_enabledstaysfalse, and thegf/v2REST routes never register.This was masked because a fresh CI run (cold cache) installs everything correctly; only cache-hit runs regressed.
Fix
In the cache-fallback step, run wp-env's own
resetinstead of a barewp core install.wp-env resetperforms the full database reinstall + configure path (and theafterResetlifecycle hook), matching a freshwp-env start.Verification
Confirmed on a cache-hit run (diagnostic, since removed):
All 4 Playwright shards green.
🤖 Generated with Claude Code