Skip to content

Commit 347f07b

Browse files
committed
Build/Test Tools: Use Git when fetching the WordPress Importer for use in tests.
This switches to using Git in the local Docker environment install script to check out a copy of the WordPress Importer plugin for use in unit tests. Previously, SVN was used and the commands were not correctly run within the Docker container. The container does not actually have SVN installed, and the script was only working when the machine running the command had SVN present. Merges [51179] to the 4.8 branch. Reviewed by swissspidy. Props czapla, alexstine, jnylen0, francina, desrosj. See #52909. See #62280. git-svn-id: https://develop.svn.wordpress.org/branches/4.8@59626 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ad20852 commit 347f07b

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

.env

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,3 @@ LOCAL_WP_ENVIRONMENT_TYPE=local
7171

7272
# The URL to use when running e2e tests.
7373
WP_BASE_URL=http://localhost:${LOCAL_PORT}
74-
75-
##
76-
# The revision number of the WordPress Importer plugin to use when running unit tests.
77-
#
78-
# This should be an SVN revision number from the official plugin repository on wordpress.org.
79-
##
80-
WP_IMPORTER_REVISION=2387243

tools/local-env/scripts/install.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ function wp_cli( cmd ) {
5252
* Downloads the WordPress Importer plugin for use in tests.
5353
*/
5454
function install_wp_importer() {
55-
const test_plugin_directory = 'tests/phpunit/data/plugins/wordpress-importer';
55+
const testPluginDirectory = 'tests/phpunit/data/plugins/wordpress-importer';
5656

57-
execSync( `docker compose exec -T php rm -rf ${test_plugin_directory} && svn checkout -r ${process.env.WP_IMPORTER_REVISION} https://plugins.svn.wordpress.org/wordpress-importer/trunk/ ${test_plugin_directory}`, { stdio: 'inherit' } );
57+
execSync( `docker compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } );
58+
execSync( `docker compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1 --branch 0.7`, { stdio: 'inherit' } );
5859
}

0 commit comments

Comments
 (0)