Skip to content

Commit 6e9f507

Browse files
schlesseraclaude
andauthored
Use cached plugin and theme installs in tests (#149)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f65bde8 commit 6e9f507

2 files changed

Lines changed: 45 additions & 12 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"wp-cli/extension-command": "^1.2 || ^2 || ^3",
2222
"wp-cli/import-command": "^1 || ^2 || ^3",
2323
"wp-cli/media-command": "^1 || ^2 || ^3",
24-
"wp-cli/wp-cli-tests": "^5"
24+
"wp-cli/wp-cli-tests": "^5.4.0"
2525
},
2626
"config": {
2727
"process-timeout": 7200,

‎features/export.feature‎

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ Feature: Export content.
314314
Scenario: Export posts from a given category
315315
Given a WP install
316316
And I run `wp site empty --yes`
317-
And I run `wp plugin install wordpress-importer --activate`
317+
And these installed and active plugins:
318+
"""
319+
wordpress-importer
320+
"""
318321

319322
When I run `wp term create category Apple --porcelain`
320323
Then STDOUT should be a number
@@ -396,7 +399,10 @@ Feature: Export content.
396399
Scenario: Export posts from a given author
397400
Given a WP install
398401
And I run `wp site empty --yes`
399-
And I run `wp plugin install wordpress-importer --activate`
402+
And these installed and active plugins:
403+
"""
404+
wordpress-importer
405+
"""
400406

401407
When I run `wp user create john john.doe@example.com --porcelain`
402408
Then STDOUT should be a number
@@ -478,7 +484,10 @@ Feature: Export content.
478484
@require-wp-5.2
479485
Scenario: Export posts should include user information
480486
Given a WP install
481-
And I run `wp plugin install wordpress-importer --activate`
487+
And these installed and active plugins:
488+
"""
489+
wordpress-importer
490+
"""
482491
And I run `wp user create user user@user.com --role=editor --display_name="Test User"`
483492
And I run `wp post generate --post_type=post --count=10 --post_author=user`
484493

@@ -551,7 +560,10 @@ Feature: Export content.
551560
And I run `wp site empty --yes`
552561
And I run `wp post create --post_title="Some page" --post_type=page`
553562
And I run `wp post generate --post_type=post --count=10`
554-
And I run `wp plugin install wordpress-importer --activate`
563+
And these installed and active plugins:
564+
"""
565+
wordpress-importer
566+
"""
555567

556568
When I run `wp post list --post_type=any --format=count`
557569
Then STDOUT should be:
@@ -670,7 +682,10 @@ Feature: Export content.
670682
Scenario: Export a site and skip the comments
671683
Given a WP install
672684
And I run `wp comment generate --post_id=1 --count=2`
673-
And I run `wp plugin install wordpress-importer --activate`
685+
And these installed and active plugins:
686+
"""
687+
wordpress-importer
688+
"""
674689

675690
When I run `wp comment list --format=count`
676691
Then STDOUT should contain:
@@ -851,7 +866,10 @@ Feature: Export content.
851866
Scenario: Export a site to stdout
852867
Given a WP install
853868
And I run `wp comment generate --post_id=1 --count=1`
854-
And I run `wp plugin install wordpress-importer --activate`
869+
And these installed and active plugins:
870+
"""
871+
wordpress-importer
872+
"""
855873

856874
When I run `wp export --stdout > export.xml`
857875
Then STDOUT should be empty
@@ -904,7 +922,10 @@ Feature: Export content.
904922
@require-wp-5.2
905923
Scenario: Export individual post with attachments
906924
Given a WP install
907-
And I run `wp plugin install wordpress-importer --activate`
925+
And these installed and active plugins:
926+
"""
927+
wordpress-importer
928+
"""
908929
And I run `wp site empty --yes`
909930

910931
When I run `wp post generate --count=10`
@@ -1012,7 +1033,10 @@ Feature: Export content.
10121033
}
10131034
add_action( 'init', 'wp_cli_region_taxonomy' );
10141035
"""
1015-
And I run `wp plugin install wordpress-importer --activate`
1036+
And these installed and active plugins:
1037+
"""
1038+
wordpress-importer
1039+
"""
10161040
And I run `wp site empty --yes`
10171041

10181042
When I run `wp term create category News --description="A news article" --porcelain`
@@ -1165,7 +1189,10 @@ Feature: Export content.
11651189
@require-wp-5.2
11661190
Scenario: Export posts should not include oembed_cache posts user information
11671191
Given a WP install
1168-
And I run `wp plugin install wordpress-importer --activate`
1192+
And these installed and active plugins:
1193+
"""
1194+
wordpress-importer
1195+
"""
11691196
And I run `wp user create user user@user.com --role=editor --display_name="Test User"`
11701197
And I run `wp user create oembed_cache_user oembed_cache@user.com --role=editor --display_name="Oembed User"`
11711198
And I run `wp post generate --post_type=post --count=10 --post_author=user`
@@ -1217,7 +1244,10 @@ Feature: Export content.
12171244
"""
12181245

12191246
When I run `wp site empty --yes`
1220-
And I run `wp plugin install wordpress-importer --activate`
1247+
And these installed and active plugins:
1248+
"""
1249+
wordpress-importer
1250+
"""
12211251
And I run `wp import {EXPORT_FILE} --authors=skip`
12221252
Then STDOUT should contain:
12231253
"""
@@ -1292,7 +1322,10 @@ Feature: Export content.
12921322
@require-wp-5.2
12931323
Scenario: Export posts with future status
12941324
Given a WP install
1295-
And I run `wp plugin install wordpress-importer --activate`
1325+
And these installed and active plugins:
1326+
"""
1327+
wordpress-importer
1328+
"""
12961329
And I run `wp site empty --yes`
12971330

12981331
When I run `wp post create --post_title='Future Post 1' --post_status=future --post_date='2050-01-01 12:00:00' --porcelain`

0 commit comments

Comments
 (0)