forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Benchmark setup HTML API #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sirreal
wants to merge
36
commits into
trunk
Choose a base branch
from
bench-html-api
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
cfd3ca4
Set up for phpbench
sirreal 5d60bdb
phpbench setup
sirreal 15e60ff
Build/Test Tools: Remove erroneous PHP tags for translations from QUn…
westonruter 7919efb
I18N: Provide gettext context to disambiguate translation strings for…
audrasjb a2479da
I18N: Provide gettext context to disambiguate translation strings for…
audrasjb 88734d4
Administration: Prevent horizontal scrollbar in contextual help panel.
audrasjb abf9109
I18N: Add context for Next/Previous strings in the jQuery UI datepicker.
SergeyBiryukov 1893a30
Build/Test Tools: Copy vendor scripts earlier in the build.
peterwilsoncc b60f8ba
Admin Reskin: Change color picker height to match new design system.
t-hamano d368a44
Connectors: Replace `plugin.slug` with `plugin.file` in connector reg…
jorgefilipecosta c5627a1
Fix: Register Akismet Anti-Spam as a connector.
jorgefilipecosta b5da8de
Admin Reskin: Correct ”Copied!” text alignment on Privacy Policy Guid…
SergeyBiryukov 2183f23
REST API: Harden Real Time Collaboration endpoint.
peterwilsoncc d0c6277
Media: Update upload file overlay colors.
joedolson d508d24
Admin: Limit scope of admin notice link design.
joedolson 8510818
Code Quality: Remove unused variable in `WP_Block_Patterns_Registry`.
SergeyBiryukov 54593bc
Tests: Move data providers and helpers in `Tests_REST_Server` for con…
SergeyBiryukov e2d6d2b
Administration: Improve dashboard widgets border styles.
audrasjb b10d2f9
Tests: Adjust Unicode tests for consistency.
SergeyBiryukov 609f25f
Tests: Move `wp_dropdown_languages()` tests to their own file.
SergeyBiryukov 4bf7a21
Merge branch 'sirreal-benchmarking' into bench-html-api
sirreal 96294ed
benchmarking js escaping
sirreal 11ed615
set_modifiable_text benches
sirreal 664b3d3
Fix php test data constant
sirreal bc057d7
Add html processing benchmarks
sirreal b5c6124
Cleanup lints
sirreal d53ba50
Add test html file
sirreal edb00ec
reorganize benchmarks
sirreal ddd5ad4
Exclude benchmarks from phpcs
sirreal c4a0adb
improve benchmarks and isolate set up
sirreal 87d212c
lint
sirreal eae77f0
prevent embedding huge HTML docs in XML results
sirreal b0c7bff
tweak revolusions and iterations
sirreal 7cb7ca7
Fix data URIs
sirreal 847c0db
Try using global namespace for special functions
sirreal 46e4771
Revert "Try using global namespace for special functions"
sirreal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| <?php | ||
| /** | ||
| * Bootstrap file for phpbench benchmarks. | ||
| * | ||
| * Loads WordPress for running benchmarks. | ||
| */ | ||
|
|
||
| define( 'PHPBENCH_ROOT', __DIR__ ); | ||
|
|
||
| if ( defined( 'WP_TESTS_CONFIG_FILE_PATH' ) ) { | ||
| $config_file_path = WP_TESTS_CONFIG_FILE_PATH; | ||
| } else { | ||
| $config_file_path = __DIR__ . '/wp-tests-config.php'; | ||
| } | ||
|
|
||
| /* | ||
| * Globalize some WordPress variables. | ||
| */ | ||
| global $wpdb, $current_site, $current_blog, $wp_rewrite, $shortcode_tags, $wp, $phpmailer, $wp_theme_directories; | ||
|
|
||
| if ( ! is_readable( $config_file_path ) ) { | ||
| exit( 1 ); | ||
| } | ||
|
|
||
| require_once $config_file_path; | ||
|
|
||
| if ( ! is_dir( ABSPATH ) ) { | ||
| exit( 1 ); | ||
| } | ||
|
Comment on lines
+27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| function tests_reset__SERVER() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid | ||
| $_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN; | ||
| $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; | ||
| $_SERVER['REQUEST_METHOD'] = 'GET'; | ||
| $_SERVER['REQUEST_URI'] = ''; | ||
| $_SERVER['SERVER_NAME'] = WP_TESTS_DOMAIN; | ||
| $_SERVER['SERVER_PORT'] = '80'; | ||
| $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; | ||
|
|
||
| unset( $_SERVER['HTTP_REFERER'] ); | ||
| unset( $_SERVER['HTTPS'] ); | ||
| } | ||
| tests_reset__SERVER(); | ||
|
|
||
| define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); | ||
|
|
||
| define( 'DIR_BENCHMARKDATA', __DIR__ . '/tests/benchmarks/data' ); | ||
| define( 'DIR_TESTDATA', __DIR__ . '/tests/phpunit/data' ); | ||
| define( 'WP_LANG_DIR', realpath( DIR_TESTDATA . '/languages' ) ); | ||
|
|
||
| /* | ||
| * Cron tries to make an HTTP request to the site, which always fails, | ||
| * because tests are run in CLI mode only. | ||
| */ | ||
| define( 'DISABLE_WP_CRON', true ); | ||
|
|
||
| define( 'WP_MEMORY_LIMIT', -1 ); | ||
| define( 'WP_MAX_MEMORY_LIMIT', -1 ); | ||
|
|
||
| $PHP_SELF = '/index.php'; | ||
| $GLOBALS['PHP_SELF'] = '/index.php'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| $_SERVER['PHP_SELF'] = '/index.php'; | ||
|
|
||
| if ( ! defined( 'WP_DEFAULT_THEME' ) ) { | ||
| define( 'WP_DEFAULT_THEME', 'default' ); | ||
| } | ||
| $wp_theme_directories = array(); | ||
|
|
||
| if ( file_exists( DIR_TESTDATA . '/themedir1' ) ) { | ||
| $wp_theme_directories[] = DIR_TESTDATA . '/themedir1'; | ||
| } | ||
|
|
||
| // Load WordPress. | ||
| require_once ABSPATH . 'wp-settings.php'; | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "./vendor/phpbench/phpbench/phpbench.schema.json", | ||
| "runner.bootstrap": "phpbench-bootstrap.php", | ||
| "runner.path": "tests/benchmarks/benchmarks" | ||
| } |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better debugging, it's helpful to output an error message to
stderrwhen the script exits due to a fatal condition. This will make it easier to diagnose setup issues when running the benchmarks.