Skip to content

Commit da1acc7

Browse files
committed
Skip broken SQLite testing for now
1 parent 43abfb5 commit da1acc7

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

features/search-replace-export.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Feature: Search / replace with file export
22

3+
@require-mysql
34
Scenario: Search / replace export to STDOUT
45
Given a WP install
56
And I run `echo ' '`
@@ -76,6 +77,7 @@ Feature: Search / replace with file export
7677
https://example.net
7778
"""
7879

80+
@require-mysql
7981
Scenario: Search / replace export to file
8082
Given a WP install
8183
And I run `wp post generate --count=100`
@@ -129,6 +131,7 @@ Feature: Search / replace with file export
129131
101
130132
"""
131133

134+
@require-mysql
132135
Scenario: Search / replace export to file with verbosity
133136
Given a WP install
134137

@@ -151,6 +154,7 @@ Feature: Search / replace with file export
151154
Error: You cannot supply --dry-run and --export at the same time.
152155
"""
153156

157+
@require-mysql
154158
Scenario: Search / replace shouldn't affect primary key
155159
Given a WP install
156160
And I run `wp post create --post_title=foo --porcelain`
@@ -191,6 +195,7 @@ Feature: Search / replace with file export
191195
Error: Unable to open export file "foo/bar.sql" for writing:
192196
"""
193197

198+
@require-mysql
194199
Scenario: Search / replace specific table
195200
Given a WP install
196201

@@ -225,6 +230,7 @@ Feature: Search / replace with file export
225230
foo
226231
"""
227232

233+
@require-mysql
228234
Scenario: Search / replace export should cater for field/table names that use reserved words or unusual characters
229235
Given a WP install
230236
# Unlike search-replace.features version, don't use `back``tick` column name as WP_CLI\Iterators\Table::build_fields() can't handle it.
@@ -268,6 +274,7 @@ Feature: Search / replace with file export
268274
"""
269275
And STDERR should be empty
270276

277+
@require-mysql
271278
Scenario: Suppress report or only report changes on export to file
272279
Given a WP install
273280

@@ -365,6 +372,7 @@ Feature: Search / replace with file export
365372
"""
366373
And STDERR should be empty
367374

375+
@require-mysql
368376
Scenario: Search / replace should remove placeholder escape on export
369377
Given a WP install
370378
And I run `wp post create --post_title=test-remove-placeholder-escape% --porcelain`
@@ -380,6 +388,7 @@ Feature: Search / replace with file export
380388
'test-remove-placeholder-escape{'
381389
"""
382390

391+
@require-mysql
383392
Scenario: NULLs exported as NULL and not null string
384393
Given a WP install
385394
And I run `wp db query "INSERT INTO wp_postmeta VALUES (9999, 9999, NULL, 'foo')"`

features/search-replace.feature

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Feature: Do global search/replace
22

3+
@require-mysql
34
Scenario: Basic search/replace
45
Given a WP install
56

@@ -41,6 +42,7 @@ Feature: Do global search/replace
4142
| wp_posts | post_content | 0 | SQL |
4243

4344

45+
@require-mysql
4446
Scenario: Multisite search/replace
4547
Given a WP multisite install
4648
And I run `wp site create --slug="foo" --title="foo" --email="foo@example.com"`
@@ -50,6 +52,7 @@ Feature: Do global search/replace
5052
| wp_2_options | option_value | 4 | PHP |
5153
| wp_blogs | path | 1 | SQL |
5254

55+
@require-mysql
5356
Scenario: Don't run on unregistered tables by default
5457
Given a WP install
5558
And I run `wp db query "CREATE TABLE wp_awesome ( id int(11) unsigned NOT NULL AUTO_INCREMENT, awesome_stuff TEXT, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;"`
@@ -66,6 +69,7 @@ Feature: Do global search/replace
6669
wp_awesome
6770
"""
6871

72+
@require-mysql
6973
Scenario: Run on unregistered, unprefixed tables with --all-tables flag
7074
Given a WP install
7175
And I run `wp db query "CREATE TABLE awesome_table ( id int(11) unsigned NOT NULL AUTO_INCREMENT, awesome_stuff TEXT, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;"`
@@ -82,6 +86,7 @@ Feature: Do global search/replace
8286
awesome_table
8387
"""
8488

89+
@require-mysql
8590
Scenario: Run on all tables matching string with wildcard
8691
Given a WP install
8792

@@ -154,12 +159,14 @@ Feature: Do global search/replace
154159
bar
155160
"""
156161

162+
@require-mysql
157163
Scenario: Quiet search/replace
158164
Given a WP install
159165

160166
When I run `wp search-replace foo bar --quiet`
161167
Then STDOUT should be empty
162168

169+
@require-mysql
163170
Scenario: Verbose search/replace
164171
Given a WP install
165172
And I run `wp post create --post_title='Replace this text' --porcelain`
@@ -202,6 +209,7 @@ Feature: Do global search/replace
202209
"""
203210
And the return code should be 1
204211

212+
@require-mysql
205213
Scenario: Search and replace within theme mods
206214
Given a WP install
207215
And a setup-theme-mod.php file:
@@ -231,6 +239,7 @@ Feature: Do global search/replace
231239
| key | value |
232240
| header_image_data | {"url":"https:\/\/example.com\/foo.jpg"} |
233241

242+
@require-mysql
234243
Scenario: Search and replace with quoted strings
235244
Given a WP install
236245

@@ -276,6 +285,7 @@ Feature: Do global search/replace
276285
And STDOUT should be empty
277286
And the return code should be 0
278287

288+
@require-mysql
279289
Scenario: Search and replace a table that has a multi-column primary key
280290
Given a WP install
281291
And I run `wp db query "CREATE TABLE wp_multicol ( "id" bigint(20) NOT NULL AUTO_INCREMENT,"name" varchar(60) NOT NULL,"value" text NOT NULL,PRIMARY KEY ("id","name"),UNIQUE KEY "name" ("name") ) ENGINE=InnoDB DEFAULT CHARSET=utf8 "`
@@ -308,6 +318,7 @@ Feature: Do global search/replace
308318
| https://newdomain.com | |
309319
| https://newdomain.com | --dry-run |
310320

321+
@require-mysql
311322
Scenario Outline: Choose replacement method (PHP or MySQL/MariaDB) given proper flags or data.
312323
Given a WP install
313324
And I run `wp option get siteurl`
@@ -324,6 +335,7 @@ Feature: Do global search/replace
324335
| | PHP | SQL |
325336
| --precise | PHP | PHP |
326337

338+
@require-mysql
327339
Scenario Outline: Ensure search and replace uses PHP (precise) mode when serialized data is found
328340
Given a WP install
329341
And I run `wp post create --post_content='<input>' --porcelain`
@@ -346,6 +358,7 @@ Feature: Do global search/replace
346358
| a:1:{s:3:"bar";s:3:"foo";} |
347359
| O:8:"stdClass":1:{s:1:"a";s:3:"foo";} |
348360

361+
@require-mysql
349362
Scenario: Search replace with a regex flag
350363
Given a WP install
351364

@@ -371,6 +384,7 @@ Feature: Do global search/replace
371384
https://BAXAMPLE.com
372385
"""
373386

387+
@require-mysql
374388
Scenario: Search replace with a regex delimiter
375389
Given a WP install
376390

@@ -469,6 +483,7 @@ Feature: Do global search/replace
469483
"""
470484
And the return code should be 1
471485

486+
@require-mysql
472487
Scenario: Formatting as count-only
473488
Given a WP install
474489
And I run `wp option set foo 'ALPHA.example.com'`
@@ -498,6 +513,7 @@ Feature: Do global search/replace
498513
0
499514
"""
500515

516+
@require-mysql
501517
Scenario: Search / replace should cater for field/table names that use reserved words or unusual characters
502518
Given a WP install
503519
And a esc_sql_ident.sql file:
@@ -525,7 +541,7 @@ Feature: Do global search/replace
525541
"""
526542
And STDERR should be empty
527543

528-
@suppress_report__only_changes
544+
@require-mysql @suppress_report__only_changes
529545
Scenario: Suppress report or only report changes
530546
Given a WP install
531547

@@ -634,7 +650,7 @@ Feature: Do global search/replace
634650
"""
635651
And STDERR should be empty
636652

637-
@no_table__no_primary_key
653+
@require-mysql @no_table__no_primary_key
638654
Scenario: Deal with non-existent table and table with no primary keys
639655
Given a WP install
640656

@@ -684,6 +700,7 @@ Feature: Do global search/replace
684700
"""
685701
And the return code should be 0
686702

703+
@require-mysql
687704
Scenario: Search / replace is case sensitive
688705
Given a WP install
689706
When I run `wp post create --post_title='Case Sensitive' --porcelain`
@@ -717,6 +734,7 @@ Feature: Do global search/replace
717734
"""
718735
And STDERR should be empty
719736

737+
@require-mysql
720738
Scenario: Logging with simple replace
721739
Given a WP install
722740

@@ -932,6 +950,7 @@ Feature: Do global search/replace
932950
Content_ab\1z__baz_1234567890_eb\1z__bez_1234567890_ib\1z__biz_1234567890_ob\1z__boz_1234567890_ub\1z__buz_
933951
"""
934952

953+
@require-mysql
935954
Scenario: Logging with prefixes and custom colors
936955
Given a WP install
937956
And I run `wp option set blogdescription 'Just another WordPress site'`
@@ -1032,6 +1051,7 @@ Feature: Do global search/replace
10321051
And STDERR should be empty
10331052

10341053
# Regression test for https://github.com/wp-cli/search-replace-command/issues/58
1054+
@require-mysql
10351055
Scenario: The parameters --regex and --all-tables-with-prefix produce valid SQL
10361056
Given a WP install
10371057
And a test_db.sql file:
@@ -1085,6 +1105,7 @@ Feature: Do global search/replace
10851105
"""
10861106

10871107
# Regression test for https://github.com/wp-cli/search-replace-command/issues/68
1108+
@require-mysql
10881109
Scenario: Incomplete classes are handled gracefully during (un)serialization
10891110

10901111
Given a WP install
@@ -1106,7 +1127,7 @@ Feature: Do global search/replace
11061127
a:1:{i:0;O:10:"CornFlakes":0:{}}
11071128
"""
11081129

1109-
@less-than-php-8.0
1130+
@require-mysql @less-than-php-8.0
11101131
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP < 8.0)
11111132
Given a WP install
11121133
And I run `wp db query "INSERT INTO wp_options (option_name,option_value) VALUES ('cereal_isation','O:13:\"mysqli_result\":5:{s:13:\"current_field\";N;s:11:\"field_count\";N;s:7:\"lengths\";N;s:8:\"num_rows\";N;s:4:\"type\";N;}')"`
@@ -1147,7 +1168,7 @@ Feature: Do global search/replace
11471168
[field_count] => 2
11481169
"""
11491170

1150-
@require-php-8.0 @less-than-php-8.1
1171+
@require-mysql @require-php-8.0 @less-than-php-8.1
11511172
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP 8.0)
11521173
Given a WP install
11531174
And I run `wp db query "INSERT INTO wp_options (option_name,option_value) VALUES ('cereal_isation','O:13:\"mysqli_result\":5:{s:13:\"current_field\";N;s:11:\"field_count\";N;s:7:\"lengths\";N;s:8:\"num_rows\";N;s:4:\"type\";N;}')"`
@@ -1188,7 +1209,7 @@ Feature: Do global search/replace
11881209
[field_count] => 2
11891210
"""
11901211

1191-
@require-php-8.1
1212+
@require-mysql @require-php-8.1
11921213
Scenario: Warn and ignore type-hinted objects that have some error in deserialization (PHP 8.1+)
11931214
Given a WP install
11941215
And I run `wp db query "INSERT INTO wp_options (option_name,option_value) VALUES ('cereal_isation','O:13:\"mysqli_result\":5:{s:13:\"current_field\";N;s:11:\"field_count\";N;s:7:\"lengths\";N;s:8:\"num_rows\";N;s:4:\"type\";N;}')"`
@@ -1272,6 +1293,7 @@ Feature: Do global search/replace
12721293
Success:
12731294
"""
12741295

1296+
@require-mysql
12751297
Scenario: Chunking a precise search and replace works without skipping lines
12761298
Given a WP install
12771299
And a create_sql_file.sh file:
@@ -1323,6 +1345,7 @@ Feature: Do global search/replace
13231345
Success: Made 0 replacements.
13241346
"""
13251347

1348+
@require-mysql
13261349
Scenario: Chunking a regex search and replace works without skipping lines
13271350
Given a WP install
13281351
And a create_sql_file.sh file:

0 commit comments

Comments
 (0)