Skip to content
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

Improve reliability of phpunit test runs across environments #1776

Merged
merged 1 commit into from Dec 27, 2018

Conversation

Projects
None yet
3 participants
@westonruter
Copy link
Member

westonruter commented Dec 23, 2018

  • Account for stylesheets in core src which may not be available. Since unit tests run for non-core use src as the ABSPATH the stylesheets pulled in from NPM are not available, and so we need to supply dummy paths.
  • Use pre_oembed_result filter instead of pre_http_request since the former is an earlier way to short-circuit the oEmbed request. Without this, Gfycat was failing on the wordpressdev environment, in particular felixarntz/wordpressdev#4.

@westonruter westonruter added this to the v 1.0.2 milestone Dec 23, 2018

@westonruter westonruter requested a review from felixarntz Dec 23, 2018

@googlebot googlebot added the cla: yes label Dec 23, 2018

@felixarntz
Copy link
Collaborator

felixarntz left a comment

LGTM!

// Specify file paths for stylesheets not available in src.
foreach ( array( 'wp-block-library', 'wp-block-library-theme' ) as $src_style_handle ) {
if ( wp_style_is( $src_style_handle, 'registered' ) ) {
wp_styles()->registered[ $src_style_handle ]->src = amp_get_asset_url( 'css/amp-default.css' ); // A dummy path.

This comment has been minimized.

Copy link
@felixarntz

felixarntz Dec 27, 2018

Collaborator

Ugh. Not great that we need to do this, but I don't see a better way.

),
);
}, 10, 3 );
return '<iframe src=\'https://gfycat.com/ifr/tautwhoppingcougar\' frameborder=\'0\' scrolling=\'no\' width=\'500\' height=\'281.25\' allowfullscreen></iframe>';

This comment has been minimized.

Copy link
@felixarntz

felixarntz Dec 27, 2018

Collaborator

Makes sense to me, hooking into a more specific filter here.

Do you know why this was failing on https://github.com/felixarntz/wordpressdev?

This comment has been minimized.

Copy link
@westonruter

westonruter Dec 27, 2018

Author Member

No, but since it is a better hook to use and it fixed the problem, I didn't dive deeper into it.

@westonruter westonruter merged commit 3d7d26c into 1.0 Dec 27, 2018

3 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the fix/tests branch Dec 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.