Skip to content

Commit 91b4e0c

Browse files
authored
Improve SQLite compatibility (#243)
* Skip some initial tests * Skip test * Skip db check * Skip more tests using an older WP version * Skip more tests * Skip `CUSTOM_USER_TABLE` tests * Clarify comments * Fix double comments * Update comments
1 parent 7a81a86 commit 91b4e0c

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed

features/core-check-update.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Feature: Check for more recent versions
22

3+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
4+
@require-mysql
35
Scenario: Check for update via Version Check API
46
Given a WP install
57
And I try `wp theme install twentytwenty --activate`

features/core-install.feature

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Feature: Install WordPress core
22

3+
# TODO: Requires investigation for SQLite support.
4+
# See https://github.com/wp-cli/core-command/issues/244
5+
@require-mysql
36
Scenario: Two WordPress installs sharing the same user table won't update existing user
47
Given an empty directory
58
And WP files
@@ -36,7 +39,7 @@ Feature: Install WordPress core
3639
When I run `wp --path=second user get testadmin --field=user_pass`
3740
Then save STDOUT as {ORIGINAL_PASSWORD}
3841

39-
When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < extra-config`
42+
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --extra-php < extra-config`
4043
Then STDOUT should be:
4144
"""
4245
Success: Generated 'wp-config.php' file.
@@ -81,6 +84,9 @@ Feature: Install WordPress core
8184
wp_users
8285
"""
8386
87+
# TODO: Requires investigation for SQLite support.
88+
# See https://github.com/wp-cli/core-command/issues/244
89+
@require-mysql
8490
Scenario: Two WordPress installs sharing the same user table will create new user
8591
Given an empty directory
8692
And WP files
@@ -107,7 +113,7 @@ Feature: Install WordPress core
107113
admin
108114
"""
109115
110-
When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < extra-config`
116+
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --extra-php < extra-config`
111117
Then STDOUT should be:
112118
"""
113119
Success: Generated 'wp-config.php' file.
@@ -187,7 +193,7 @@ Feature: Install WordPress core
187193
And the wp-settings.php file should exist
188194
And the {SUITE_CACHE_DIR}/core/wordpress-{VERSION}-de_DE.tar.gz file should exist
189195
190-
When I run `wp config create --dbname={DB_NAME} --dbuser={DB_USER} --dbpass={DB_PASSWORD} --dbhost={DB_HOST} --locale=de_DE`
196+
When I run `wp config create --dbname={DB_NAME} --dbuser={DB_USER} --dbpass={DB_PASSWORD} --dbhost={DB_HOST} --locale=de_DE --skip-check`
191197
Then STDOUT should be:
192198
"""
193199
Success: Generated 'wp-config.php' file.
@@ -216,6 +222,8 @@ Feature: Install WordPress core
216222
Kategorien
217223
"""
218224
225+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
226+
@require-mysql
219227
Scenario: Install WordPress with locale set to de_DE on WP >= 4.0
220228
Given an empty directory
221229
And an empty cache
@@ -231,7 +239,7 @@ Feature: Install WordPress core
231239
And the wp-settings.php file should exist
232240
And the {SUITE_CACHE_DIR}/core/wordpress-{VERSION}-de_DE.tar.gz file should exist
233241

234-
When I run `wp config create --dbname={DB_NAME} --dbuser={DB_USER} --dbpass={DB_PASSWORD} --dbhost={DB_HOST} --locale=de_DE`
242+
When I run `wp config create --dbname={DB_NAME} --dbuser={DB_USER} --dbpass={DB_PASSWORD} --dbhost={DB_HOST} --locale=de_DE --skip-check`
235243
Then STDOUT should be:
236244
"""
237245
Success: Generated 'wp-config.php' file.
@@ -286,6 +294,7 @@ Feature: Install WordPress core
286294
Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:
287295
"""
288296

297+
@require-mysql
289298
Scenario: Install WordPress multisite with existing multisite constants in wp-config file
290299
Given an empty directory
291300
And WP files
@@ -302,7 +311,7 @@ Feature: Install WordPress core
302311
define( 'BLOG_ID_CURRENT_SITE', 1 );
303312
"""
304313

305-
When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < extra-config`
314+
When I run `wp config create {CORE_CONFIG_SETTINGS} --extra-php < extra-config`
306315
Then STDOUT should be:
307316
"""
308317
Success: Generated 'wp-config.php' file.

features/core-update-db.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Feature: Update core's database
22

3+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
4+
@require-mysql
35
Scenario: Update db on a single site
46
Given a WP install
57
And a disable_sidebar_check.php file:
@@ -25,6 +27,8 @@ Feature: Update core's database
2527
Success: WordPress database already at latest db version 47018.
2628
"""
2729

30+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
31+
@require-mysql
2832
Scenario: Dry run update db on a single site
2933
Given a WP install
3034
And a disable_sidebar_check.php file:
@@ -51,6 +55,8 @@ Feature: Update core's database
5155
45805
5256
"""
5357

58+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
59+
@require-mysql
5460
Scenario: Update db across network
5561
Given a WP multisite install
5662
And a disable_sidebar_check.php file:
@@ -91,6 +97,8 @@ Feature: Update core's database
9197
{UPDATE_VERSION}
9298
"""
9399

100+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
101+
@require-mysql
94102
Scenario: Update db across network, dry run
95103
Given a WP multisite install
96104
And a disable_sidebar_check.php file:

features/core-update.feature

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Feature: Update WordPress core
22

3+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
4+
@require-mysql
35
Scenario: Update from a ZIP file
46
Given a WP install
57
And I try `wp theme install twentytwenty --activate`
@@ -63,6 +65,8 @@ Feature: Update WordPress core
6365
{WP_VERSION-4.1-latest}
6466
"""
6567

68+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
69+
@require-mysql
6670
Scenario: Update to the latest minor release (PHP 7.1 compatible with WP >= 3.9)
6771
Given a WP install
6872
And I try `wp theme install twentytwenty --activate`
@@ -97,6 +101,8 @@ Feature: Update WordPress core
97101
{WP_VERSION-4.1-latest}
98102
"""
99103

104+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
105+
@require-mysql
100106
Scenario: Core update from cache
101107
Given a WP install
102108
And I try `wp theme install twentytwenty --activate`
@@ -146,6 +152,8 @@ Feature: Update WordPress core
146152
Updating
147153
"""
148154

155+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
156+
@require-mysql
149157
Scenario: Ensure cached partial upgrades aren't used in full upgrade
150158
Given a WP install
151159
And I try `wp theme install twentytwenty --activate`
@@ -215,7 +223,8 @@ Feature: Update WordPress core
215223
wordpress-4.2.4-partial-1-en_US.zip
216224
"""
217225

218-
@less-than-php-7.3
226+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
227+
@less-than-php-7.3 @require-mysql
219228
Scenario: Make sure files are cleaned up
220229
Given a WP install
221230
And I try `wp theme install twentytwenty --activate`
@@ -250,6 +259,8 @@ Feature: Update WordPress core
250259
When I run `wp post create --post_title='Test post' --porcelain`
251260
Then STDOUT should be a number
252261

262+
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
263+
@require-mysql
253264
Scenario: Make sure files are cleaned up with mixed case
254265
Given a WP install
255266
And I try `wp theme install twentytwenty --activate`

features/core.feature

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Feature: Manage WordPress installation
22

3+
# `wp db create` does not yet work on SQLite,
4+
# See https://github.com/wp-cli/db-command/issues/234
5+
@require-mysql
36
Scenario: Database doesn't exist
47
Given an empty directory
58
And WP files
@@ -210,6 +213,9 @@ Feature: Manage WordPress installation
210213
1
211214
"""
212215
216+
# `wp db reset` does not yet work on SQLite,
217+
# See https://github.com/wp-cli/db-command/issues/234
218+
@require-mysql
213219
Scenario: Install multisite from scratch, with MULTISITE already set in wp-config.php
214220
Given a WP multisite install
215221
And I run `wp db reset --yes`
@@ -244,6 +250,8 @@ Feature: Manage WordPress installation
244250
"""
245251
And the return code should be 1
246252

253+
# SQLite compat blocked by https://github.com/wp-cli/wp-cli-tests/pull/188.
254+
@require-mysql
247255
Scenario: Custom wp-content directory
248256
Given a WP install
249257
And a custom wp-content directory
@@ -301,7 +309,9 @@ Feature: Manage WordPress installation
301309
"""
302310
And the return code should be 1
303311

304-
@require-php-7.0
312+
# `wp db create` does not yet work on SQLite,
313+
# See https://github.com/wp-cli/db-command/issues/234
314+
@require-php-7.0 @require-mysql
305315
Scenario: Install WordPress in a subdirectory
306316
Given an empty directory
307317
And a wp-config.php file:

0 commit comments

Comments
 (0)