-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10048 from google/e2e-debug
Fix flaky E2E tests
- Loading branch information
Showing
5 changed files
with
108 additions
and
145 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Plugin Name: E2E Time Endpoint | ||
* Description: REST Endpoint for supporting E2E tests. | ||
* | ||
* @package Google\Site_Kit | ||
* @copyright 2025 Google LLC | ||
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 | ||
* @link https://sitekit.withgoogle.com | ||
*/ | ||
|
||
use Google\Site_Kit\Core\REST_API\REST_Routes; | ||
|
||
add_action( | ||
'rest_api_init', | ||
function () { | ||
if ( ! defined( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE' ) ) { | ||
return; | ||
} | ||
|
||
register_rest_route( | ||
REST_Routes::REST_ROOT, | ||
'e2e/util/data/time', // Required for use with SK API. | ||
array( | ||
'methods' => WP_REST_Server::READABLE, | ||
'callback' => function () { | ||
return array( | ||
'time' => time(), | ||
'microtime' => microtime(), | ||
); | ||
}, | ||
'permission_callback' => '__return_true', | ||
) | ||
); | ||
} | ||
); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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