Merge pull request #284 from wojsmol/fix-variables-in-tests

This commit is contained in:
Alain Schlesser 2021-03-24 15:32:47 +00:00 committed by GitHub
commit 31e5e2af54
3 changed files with 8 additions and 8 deletions

View file

@ -13,7 +13,7 @@
],
"require": {
"wp-cli/wp-cli": "^2.5",
"wp-cli/wp-cli-tests": "^3.0.9"
"wp-cli/wp-cli-tests": "^3.0.10"
},
"require-dev": {
"wp-cli/extension-command": "^1.2 || ^2"

View file

@ -29,7 +29,7 @@ Feature: Scaffold install-wp-tests.sh tests
And save STDOUT as {PLUGIN_DIR}
And I run `wp scaffold plugin hello-world`
# Hardcoded for GHA, needs to be made more flexible for local setups.
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h$MYSQL_HOST -P$MYSQL_TCP_PORT --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
And I try `rm -fr /tmp/behat-wordpress`

@ -76,7 +76,7 @@ Feature: Scaffold install-wp-tests.sh tests
"""

# Hardcoded for GHA, needs to be made more flexible for local setups.
When I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h$MYSQL_HOST -P$MYSQL_TCP_PORT --protocol=tcp -e "SHOW DATABASES"`
When I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
Then the return code should be 0
And STDOUT should contain:
"""
@ -115,7 +115,7 @@ Feature: Scaffold install-wp-tests.sh tests
And save STDOUT as {PLUGIN_DIR}
And I run `wp scaffold plugin hello-world`
# Hardcoded for GHA, needs to be made more flexible for local setups.
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h$MYSQL_HOST -P$MYSQL_TCP_PORT --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
And I try `rm -fr /tmp/behat-wordpress`

@ -175,7 +175,7 @@ Feature: Scaffold install-wp-tests.sh tests
"""

# Hardcoded for GHA, needs to be made more flexible for local setups.
When I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h$MYSQL_HOST -P$MYSQL_TCP_PORT --protocol=tcp -e "SHOW DATABASES"`
When I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
Then the return code should be 0
And STDOUT should contain:
"""
@ -191,7 +191,7 @@ Feature: Scaffold install-wp-tests.sh tests
And save STDOUT as {PLUGIN_DIR}
And I run `wp scaffold plugin hello-world`
# Hardcoded for GHA, needs to be made more flexible for local setups.
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h$MYSQL_HOST -P$MYSQL_TCP_PORT --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
And I try `rm -fr /tmp/behat-wordpress`

@ -241,7 +241,7 @@ Feature: Scaffold install-wp-tests.sh tests
"""

# Hardcoded for GHA, needs to be made more flexible for local setups.
When I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h$MYSQL_HOST -P$MYSQL_TCP_PORT --protocol=tcp -e "SHOW DATABASES"`
When I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
Then the return code should be 0
And STDOUT should contain:
"""

View file

@ -89,7 +89,7 @@ Feature: Scaffold theme unit tests
<?php echo __FILE__ . " loaded.\n";
"""
# Hardcoded for GHA, needs to be made more flexible for local setups.
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h$MYSQL_HOST -P$MYSQL_TCP_PORT --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I run `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
And I try `rm -fr /tmp/behat-wordpress`
And I try `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib WP_CORE_DIR=/tmp/behat-wordpress {THEME_DIR}/p2child/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest`