Conversation
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
There was a problem hiding this comment.
Code Review
This pull request enhances SQLite compatibility for export feature tests by removing MySQL-specific tags and replacing SQL-specific functions with PHP equivalents via wp eval. It also implements dynamic post ID lookups to handle non-sequential auto-increment behavior. Feedback was provided to consolidate multiple wp eval calls into a single command to optimize performance by reducing WordPress bootstrap overhead.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Updates the Behat acceptance tests for the export command to run successfully under WP_CLI_TEST_DBTYPE=sqlite by removing MySQL-specific assumptions in two scenarios.
Changes:
- Makes the “starting post ID” export scenario deterministic by deriving the start ID from the generated posts instead of hardcoding it.
- Replaces a MySQL-only
REPEAT()usage in a fixture with a SQLite-compatiblewp eval+str_repeat()approach. - Removes
@require-mysqlfrom the two affected scenarios so they execute under SQLite.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
With this PR, all the MySQL 5.6/5.7 are timing out. This needs investigating. |
Fixes #112
Two Behat scenarios fail under
WP_CLI_TEST_DBTYPE=sqlitebecause their fixtures use MySQL-only features. The command source already uses portable SQL — only the tests needed fixing.Changes
Scenario: Export posts from a given starting post ID— replaced hardcoded--start_id=6withwp post list --offset=5 --posts_per_page=1 --format=ids. SQLite doesn't reset auto-increment onwp site empty, so the generated IDs aren't always 1..10 and the hardcoded value matched 8 posts instead of 5.Scenario: Export without splitting the dump— swappedwp db query "... REPEAT('A', 4*1024*1024)"forwp eval "update_post_meta(1, '_dummy_N', str_repeat('A', 4*1024*1024))". SQLite has noREPEAT()function.Both scenarios drop their
@require-mysqltag.19 other scenarios in this file still carry
@require-mysql. They all pass under SQLite today if the tag is stripped (I verified by running the full suite with tags removed), but opening them up is a CI coverage change rather than a bug fix — separate concern, easier to review on its own, so I left them for a follow-up PR.Related: wp-cli/.github#94