From 4fa6171ecb91b225b9d3c6f077c5eda84e781df9 Mon Sep 17 00:00:00 2001 From: Hans Morbach <6433480+hansmorb@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:02:57 -0400 Subject: [PATCH] fix plugin activation sometimes not working --- .wp-env.json | 6 +++--- bin/setup-cypress-env.sh | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.wp-env.json b/.wp-env.json index 22b4e9254..6f6052fe0 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -2,11 +2,11 @@ "phpVersion": "7.4", "core": "Wordpress/Wordpress#6.3.1", "plugins": [ - ".", + ".", "https://downloads.wordpress.org/plugin/wp-crontrol.zip", - "https://downloads.wordpress.org/plugin/wordpress-importer.zip", + "https://downloads.wordpress.org/plugin/wordpress-importer.zip", "https://downloads.wordpress.org/plugin/query-monitor.zip", - "https://downloads.wordpress.org/plugin/wp-mail-logging.zip" + "https://downloads.wordpress.org/plugin/wp-mail-logging.zip" ], "port": 1000, "testsPort": 1001, diff --git a/bin/setup-cypress-env.sh b/bin/setup-cypress-env.sh index 3341488d7..4dad1131e 100755 --- a/bin/setup-cypress-env.sh +++ b/bin/setup-cypress-env.sh @@ -10,4 +10,7 @@ # Install our example posts from a WP export file ./bin/wp-env-cli tests-wordpress "wp --allow-root import /var/www/html/wp-content/plugins/commonsbooking/cypress/wordpress-files/content-example.xml --authors=create" # Create subscriber with username "subscriber" and password "password" -./bin/wp-env-cli tests-wordpress "wp --allow-root user create subscriber sub@sub.de --role=subscriber --user_pass=password" \ No newline at end of file +./bin/wp-env-cli tests-wordpress "wp --allow-root user create subscriber sub@sub.de --role=subscriber --user_pass=password" +# For some reason, some plugin activation tasks do not run in CI, so we deactivate and reactivate the plugin +./bin/wp-env-cli tests-wordpress "wp --allow-root plugin deactivate commonsbooking" +./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate commonsbooking" \ No newline at end of file