Update behat-data URLs in tests#139
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the asset URLs in the export.feature file, migrating them from wp-cli.org to wp-cli.github.io. The review feedback suggests further improving these changes by using https instead of http to ensure secure connections and prevent unnecessary redirects.
| And save STDOUT as {EXPORT_ATTACHMENT_POST_ID} | ||
|
|
||
| When I run `wp media import 'http://wp-cli.org/behat-data/codeispoetry.png' --post_id={EXPORT_ATTACHMENT_POST_ID} --porcelain` | ||
| When I run `wp media import 'http://wp-cli.github.io/behat-data/codeispoetry.png' --post_id={EXPORT_ATTACHMENT_POST_ID} --porcelain` |
There was a problem hiding this comment.
Use https instead of http for the asset URL. GitHub Pages supports and often enforces HTTPS, so using it directly avoids unnecessary redirects and provides a more secure connection for downloading test assets.
When I run `wp media import 'https://wp-cli.github.io/behat-data/codeispoetry.png' --post_id={EXPORT_ATTACHMENT_POST_ID} --porcelain`
| And save STDOUT as {IGNORE_ATTACHMENT_POST_ID} | ||
|
|
||
| When I run `wp media import 'http://wp-cli.org/behat-data/white-150-square.jpg' --post_id={IGNORE_ATTACHMENT_POST_ID} --porcelain` | ||
| When I run `wp media import 'http://wp-cli.github.io/behat-data/white-150-square.jpg' --post_id={IGNORE_ATTACHMENT_POST_ID} --porcelain` |
There was a problem hiding this comment.
Use https instead of http for the asset URL. GitHub Pages supports and often enforces HTTPS, so using it directly avoids unnecessary redirects and provides a more secure connection for downloading test assets.
When I run `wp media import 'https://wp-cli.github.io/behat-data/white-150-square.jpg' --post_id={IGNORE_ATTACHMENT_POST_ID} --porcelain`
There was a problem hiding this comment.
Pull request overview
Updates Behat acceptance tests to use the new hosting location for behat-data assets, aligning with the wp-cli.org redirect change referenced in the PR description.
Changes:
- Updated
wp media importfixture URLs in the export feature to point towp-cli.github.io/behat-data.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| And save STDOUT as {EXPORT_ATTACHMENT_POST_ID} | ||
|
|
||
| When I run `wp media import 'http://wp-cli.org/behat-data/codeispoetry.png' --post_id={EXPORT_ATTACHMENT_POST_ID} --porcelain` | ||
| When I run `wp media import 'http://wp-cli.github.io/behat-data/codeispoetry.png' --post_id={EXPORT_ATTACHMENT_POST_ID} --porcelain` |
There was a problem hiding this comment.
Use https:// for the GitHub Pages behat-data URLs. GitHub Pages will typically redirect http to https, which adds an extra request and can fail in environments that block insecure HTTP or redirects.
| And save STDOUT as {IGNORE_ATTACHMENT_POST_ID} | ||
|
|
||
| When I run `wp media import 'http://wp-cli.org/behat-data/white-150-square.jpg' --post_id={IGNORE_ATTACHMENT_POST_ID} --porcelain` | ||
| When I run `wp media import 'http://wp-cli.github.io/behat-data/white-150-square.jpg' --post_id={IGNORE_ATTACHMENT_POST_ID} --porcelain` |
There was a problem hiding this comment.
Use https:// for the GitHub Pages behat-data URLs. Using http relies on redirects and makes the test dependent on insecure HTTP being allowed.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
See https://make.wordpress.org/systems/2026/04/23/redirect-request-for-wp-cli-org/