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

Promote a non-200 response from the cron spawn test to an error #66

Open
wants to merge 2 commits into
base: master
from

Conversation

@johnbillion
Copy link
Contributor

@johnbillion johnbillion commented Apr 25, 2020

Fixes #65

Note that the current feature test for testing the cron spawner sends an HTTP request to example.com (which is the default domain configured for the tests), so here I'm removing it because it's useless and it's not possible to affect its response. Suggestions welcome for improving this.

@johnbillion johnbillion requested a review from wp-cli/committers as a code owner Apr 25, 2020
Scenario: Testing WP-Cron
When I try `wp cron test`
Then STDERR should not contain:
"""
Error:
"""

Comment on lines -192 to -198

This comment has been minimized.

@schlessera

schlessera May 6, 2020
Member

Instead of deleting this test, I think it should stay for a valid setup check, and we need to add a second test after deleting the wp-cron.php to verify that it does indeed throw an error.

This comment has been minimized.

@johnbillion

johnbillion May 6, 2020
Author Contributor

As I mentioned in the issue description, this scenario performs a request to example.com over the internet (which returns a 404 because example.com doesn't use WordPress).

@schlessera Does WP-CLI contain any existing tests which perform an HTTP request to an actual local WordPress site?

This comment has been minimized.

@schlessera

schlessera May 6, 2020
Member

You could probably point to the proper WordPress instance using something like this as setup and populating the options accordingly:

Given a WP install
And I launch in the background `wp server --host=localhost --port=8080`

This comment has been minimized.

@johnbillion

johnbillion May 6, 2020
Author Contributor

Ah yeah nice, I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.