test(2meet-data-optimizer): add live test runner and failing shadow_read write suite
- Add tests/live: a `wp eval-file` runner (PASS/FAIL/XFAIL/XPASS/SKIP) with fixtures that override entity modes in process (pre_option) and read native / flat values with plain SQL, so WP core meta flows run for real - shadow_write suite reproduces the dev36 finding: in shadow_read, update_*_meta returns false and native meta is never written (3 XFAIL marked for PR-056); the dual_write control passes - Move the dev36 integration harness into tests/live/tools; outputs go to cwd / $TMDO_LIVE_OUT, site URL and path are env-configurable - Verify: wp --path=<dev36> eval-file tests/live/run.php shadow_write → 1 passed, 3 xfail; unit 658 OK, integration 480 OK, phpcs (phpcs.xml) 0, stan OK - PR: PR-052
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# Live test suite
|
||||
|
||||
Tests that must run inside a real WordPress site, because the stubbed
|
||||
`tests/integration` bootstrap cannot reproduce:
|
||||
|
||||
- WP core meta flows (`update_metadata()` reads the old value through
|
||||
`get_metadata_raw()` before writing — the shadow_read write-loss bug lives there)
|
||||
- the SQL that `WP_Query` actually builds, and hook priorities
|
||||
- HivePress / WooCommerce behaviour (`pre_get_posts` sort clauses, empty-key
|
||||
meta reads, direct-SQL stock updates)
|
||||
|
||||
**Never run against a production site.** Suites create and delete fixtures
|
||||
(`tmdo_live_*` users, `tmdo-live-*` terms). Entity modes are overridden in
|
||||
process through `pre_option_wpdo_bridge_modes`; nothing is written to
|
||||
`wpdo_bridge_modes` or `wpdo_hook_bus_enabled`.
|
||||
|
||||
The reference site is dev36 (HivePress + Marketplace + WooCommerce), with this
|
||||
plugin symlinked from the `plugins-dev` worktree while developing.
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
wp --path=/var/www/Studio/wp-local-dev36 eval-file tests/live/run.php <suite> [<suite> ...]
|
||||
```
|
||||
|
||||
Exit code 0 when every test passed, 1 otherwise. Output per test:
|
||||
|
||||
| Status | Meaning |
|
||||
|---|---|
|
||||
| PASS / FAIL | normal |
|
||||
| XFAIL | known bug, test marked `xfail` with the PR that fixes it; not counted as a failure |
|
||||
| XPASS | an `xfail` test passed — counted as a failure so the fixing PR removes the marker |
|
||||
| SKIP | the site does not register the key / taxonomy the test needs |
|
||||
|
||||
## Suites
|
||||
|
||||
| Suite | Covers |
|
||||
|---|---|
|
||||
| `shadow_write` | writes in shadow_read reach native meta (xfail until PR-056) |
|
||||
|
||||
## Tools (`tools/`)
|
||||
|
||||
Benchmark and data-flow helpers used for the 2026-09-26 dev36 integration test.
|
||||
Output files go to the current directory (`qbench`) or `$TMDO_LIVE_OUT`
|
||||
(default `/tmp`, `run_batch.sh`), never into the repo.
|
||||
|
||||
| Tool | Use |
|
||||
|---|---|
|
||||
| `seed.php` | `wp eval-file seed.php <vendors\|listings\|requests\|reviews\|products\|orders\|terms> <n> [tag]` — seed through real HivePress / WC APIs |
|
||||
| `run_batch.sh` | `run_batch.sh <tag> [divisor]` — parallel seeding batch (`TMDO_LIVE_WP_PATH`, `TMDO_LIVE_OUT`) |
|
||||
| `clone.sql` | bench only: clone hp_listing rows to reach large scale (`sed "s/__K__/<n>/" clone.sql \| wp db query`) |
|
||||
| `checker.php` | `wp eval-file checker.php [entity]` — native vs flat consistency per registered key (SQL only) |
|
||||
| `qbench.php` / `qdiff.php` | run 16 WP_Query shapes, then diff two runs (native vs routed): result sets, order, latency, SQL errors |
|
||||
| `mut.php` | data-flow mutations through HivePress models, WC CRUD and core APIs; prints native / flat / API values |
|
||||
| `fe.sh` + `zz-s36-probe.php` | front-end search probe (`TMDO_LIVE_URL`). Copy the probe into `wp-content/mu-plugins/` only for the run and remove it afterwards; it only answers requests carrying `X-S36-Probe: 1` |
|
||||
Reference in New Issue
Block a user