Revert "Try importing instead from a generated dump"

This reverts commit 987dc471c9.
This commit is contained in:
Bart Kalisz 2024-04-04 12:32:25 +02:00
parent 987dc471c9
commit c8d008cb20
2 changed files with 27 additions and 3054 deletions

File diff suppressed because one or more lines are too long

View File

@ -6,29 +6,18 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
head_dir=$(cd "$(dirname "$script_dir")" && cd ../../.. && pwd)
relative_path=${script_dir#$head_dir/}
db_dir="$script_dir/databases"
if [ -f "$db_dir/default.sql" ]; then
# Import the initial database.
# wp-env run tests-cli wp db import blocks_e2e_default.sql
docker exec $(docker ps -aqf name=tests-cli) mysql -h tests-mysql -u root -ppassword tests-wordpress <"$db_dir/default.sql"
printf "Default database imported successfully!\n\n"
exit 0
else
printf "Default database not found, creating a new one.\n\n"
# Generate the child themes zip files before running the tests.
# By doing so, we ensure that the zip files are up-to-date.
themes_dir="$script_dir/themes"
themes=(
# Generate the child themes zip files before running the tests.
# By doing so, we ensure that the zip files are up-to-date.
themes_dir="$script_dir/themes"
themes=(
"storefront-child__block-notices-filter"
"storefront-child__block-notices-template"
"storefront-child__classic-notices-template"
"twentytwentyfour-child__block-notices-filter"
"twentytwentyfour-child__block-notices-template"
"twentytwentyfour-child__classic-notices-template"
)
for theme in "${themes[@]}"; do
)
for theme in "${themes[@]}"; do
# Define the path to the theme directory and the zip file.
theme_dir="$themes_dir/$theme"
zip_file="$themes_dir/$theme.zip"
@ -43,12 +32,7 @@ else
# Then, create a fresh zip file.
echo "Creating zip file for $theme."
(cd "$themes_dir" && zip -r "$zip_file" "$theme" -x "*.git*" -x "*node_modules*")
done
done
# Run the main script in the container for better performance.
wp-env run tests-cli -- bash wp-content/plugins/woocommerce/blocks-bin/playwright/scripts/index.sh
# Export the initial database.
# wp-env run tests-cli wp db export blocks_e2e_default.sql
docker exec $(docker ps -aqf name=tests-cli) mysqldump -h tests-mysql -u root -ppassword tests-wordpress >"$db_dir/default.sql"
fi
# Run the main script in the container for better performance.
wp-env run tests-cli -- bash wp-content/plugins/woocommerce/blocks-bin/playwright/scripts/index.sh