diff --git a/features/export.feature b/features/export.feature index 2e0c9a98..820dfe17 100644 --- a/features/export.feature +++ b/features/export.feature @@ -502,7 +502,7 @@ Feature: Export content. Test User """ - @require-wp-5.2 @require-mysql + @require-wp-5.2 Scenario: Export posts from a given starting post ID Given a WP install @@ -520,7 +520,11 @@ Feature: Export content. 10 """ - When I run `wp export --start_id=6` + # Read the 6th post's ID instead of hardcoding --start_id=6. SQLite does not reset auto-increment on `wp site empty`, so generated IDs aren't always 1..10. + When I run `wp post list --post_type=post --orderby=ID --order=ASC --posts_per_page=1 --offset=5 --format=ids` + Then save STDOUT as {START_ID} + + When I run `wp export --start_id={START_ID}` Then save STDOUT 'Writing to file %s' as {EXPORT_FILE} When I run `wp site empty --yes` @@ -801,14 +805,10 @@ Feature: Export content. """ - @require-mysql Scenario: Export without splitting the dump Given a WP install - # Make export file > 15MB so will split by default. Need to split into 4 * 4MB to stay below 10% of default redo log size of 48MB, otherwise get MySQL error. - And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"` - And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"` - And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"` - And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"` + # Make export file > 15MB so will split by default. Need to split into 4 * 4MB to stay below 10% of default redo log size of 48MB, otherwise get MySQL error. Use `wp eval` + `str_repeat` because SQLite has no REPEAT() function. All four rows go through a single `wp eval` to avoid four WordPress bootstraps. + And I run `wp eval "update_post_meta(1, '_dummy_0', str_repeat('A', 4 * 1024 * 1024)); update_post_meta(1, '_dummy_1', str_repeat('A', 4 * 1024 * 1024)); update_post_meta(1, '_dummy_2', str_repeat('A', 4 * 1024 * 1024)); update_post_meta(1, '_dummy_3', str_repeat('A', 4 * 1024 * 1024));"` When I run `wp export` Then STDOUT should contain: