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,22 @@
|
||||
<?php
|
||||
/**
|
||||
* TEMPORARY test probe for the 2meet-DO integration test (2026-09-26). Delete after testing.
|
||||
* Only active when the request carries header "X-S36-Probe: 1".
|
||||
*/
|
||||
if ( empty( $_SERVER['HTTP_X_S36_PROBE'] ) ) {
|
||||
return;
|
||||
}
|
||||
add_action(
|
||||
'template_redirect',
|
||||
function () {
|
||||
global $wp_query, $wpdb;
|
||||
$ids = wp_list_pluck( (array) $wp_query->posts, 'ID' );
|
||||
header( 'X-S36-Found: ' . (int) $wp_query->found_posts );
|
||||
header( 'X-S36-Ids: ' . implode( ',', array_map( 'intval', $ids ) ) );
|
||||
header( 'X-S36-Queries: ' . (int) $wpdb->num_queries );
|
||||
header( 'X-S36-Routed: ' . ( false !== strpos( (string) $wp_query->request, 'wpdo' ) ? 1 : 0 ) );
|
||||
header( 'X-S36-Sql: ' . substr( preg_replace( '/\s+/', ' ', (string) $wp_query->request ), 0, 1500 ) );
|
||||
header( 'X-S36-Ms: ' . round( ( microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT'] ) * 1000 ) );
|
||||
},
|
||||
0
|
||||
);
|
||||
Reference in New Issue
Block a user