From 4beb9ecd8ae2b1d0452818b1518b3926378bd5b4 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 6 Jan 2025 13:43:20 +0100 Subject: [PATCH 1/5] Update default blueprint with latest schema --- env/blueprints/setup.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/env/blueprints/setup.json b/env/blueprints/setup.json index 7d54d0f..4cc2949 100644 --- a/env/blueprints/setup.json +++ b/env/blueprints/setup.json @@ -30,10 +30,11 @@ }, { "step": "installTheme", - "themeZipFile": { + "themeData": { "resource": "wordpress.org/themes", "slug": "twentytwentyone" }, + "ifAlreadyInstalled": "skip", "options": { "activate": true, "importStarterContent": false @@ -41,10 +42,11 @@ }, { "step": "installTheme", - "themeZipFile": { + "themeData": { "resource": "wordpress.org/themes", "slug": "twentytwentythree" }, + "ifAlreadyInstalled": "skip", "options": { "activate": false, "importStarterContent": false From 0730384f00e96ae69d96a64f110db152d9cf22c5 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 6 Jan 2025 13:52:05 +0100 Subject: [PATCH 2/5] Debug arguments --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 8e11892..f2a94f4 100644 --- a/action.yml +++ b/action.yml @@ -180,6 +180,7 @@ runs: ARGS+=(--php=$PHP_VERSION) echo "::group::Start Playground server" + printf "Providing arguments: %s," "${ARGS[@]}" ./node_modules/@wp-playground/cli/wp-playground.js server "${ARGS[@]}" & echo "::endgroup::" env: From 36c3558dfa1c74b8b8b6bb80b998e038a79f213b Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 6 Jan 2025 13:52:11 +0100 Subject: [PATCH 3/5] Add debug test --- .github/workflows/test-debug.yml | 27 +++++++++++++++++++ tests/performance-blueprint.json | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/test-debug.yml create mode 100644 tests/performance-blueprint.json diff --git a/.github/workflows/test-debug.yml b/.github/workflows/test-debug.yml new file mode 100644 index 0000000..cca4fe5 --- /dev/null +++ b/.github/workflows/test-debug.yml @@ -0,0 +1,27 @@ +name: 'Debug Tests' +on: # rebuild any PRs and main branch changes + pull_request: + push: + branches: + - main + - 'releases/*' + +jobs: + complex: + name: 'Run tests' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run performance tests + uses: ./ + with: + urls: | + / + /wp-admin/ + plugins: | + ./tests/dummy-plugin + blueprint: './tests/performance-blueprint.json' + iterations: 5 + repetitions: 1 diff --git a/tests/performance-blueprint.json b/tests/performance-blueprint.json new file mode 100644 index 0000000..1cc090c --- /dev/null +++ b/tests/performance-blueprint.json @@ -0,0 +1,45 @@ +{ + "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "plugins": [ + "woocommerce", + "email-log" + ], + "extraLibraries": [ + "wp-cli" + ], + "steps": [ + { + "step": "defineWpConfigConsts", + "consts": { + "WP_DEBUG": true, + "WP_CACHE": true + } + }, + { + "step": "activatePlugin", + "pluginName": "WooCommerce", + "pluginPath": "/wordpress/wp-content/plugins/woocommerce" + }, + { + "step": "activatePlugin", + "pluginName": "Email Log", + "pluginPath": "/wordpress/wp-content/plugins/email-log" + }, + { + "step": "installTheme", + "themeData": { + "resource": "url", + "url": "https://downloads.wordpress.org/theme/storefront.zip" + }, + "ifAlreadyInstalled": "skip", + "options": { + "activate": true, + "importStarterContent": false + } + }, + { + "step": "login", + "username": "admin" + } + ] +} From 8efaf8ee078aebcf7ab5b88bc1d161d02b768d5a Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 6 Jan 2025 13:57:41 +0100 Subject: [PATCH 4/5] Fix output --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f2a94f4..3d16d93 100644 --- a/action.yml +++ b/action.yml @@ -180,7 +180,11 @@ runs: ARGS+=(--php=$PHP_VERSION) echo "::group::Start Playground server" - printf "Providing arguments: %s," "${ARGS[@]}" + + IFS=, + echo "Providing arguments: ${ARGS[*]}" + unset IFS; + ./node_modules/@wp-playground/cli/wp-playground.js server "${ARGS[@]}" & echo "::endgroup::" env: From 541b7ce009ce6dd027977d9e6412781923b9273a Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 7 Jan 2025 17:49:28 +0100 Subject: [PATCH 5/5] Remove debug steps --- .github/workflows/test-debug.yml | 27 ------------------- tests/performance-blueprint.json | 45 -------------------------------- 2 files changed, 72 deletions(-) delete mode 100644 .github/workflows/test-debug.yml delete mode 100644 tests/performance-blueprint.json diff --git a/.github/workflows/test-debug.yml b/.github/workflows/test-debug.yml deleted file mode 100644 index cca4fe5..0000000 --- a/.github/workflows/test-debug.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: 'Debug Tests' -on: # rebuild any PRs and main branch changes - pull_request: - push: - branches: - - main - - 'releases/*' - -jobs: - complex: - name: 'Run tests' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run performance tests - uses: ./ - with: - urls: | - / - /wp-admin/ - plugins: | - ./tests/dummy-plugin - blueprint: './tests/performance-blueprint.json' - iterations: 5 - repetitions: 1 diff --git a/tests/performance-blueprint.json b/tests/performance-blueprint.json deleted file mode 100644 index 1cc090c..0000000 --- a/tests/performance-blueprint.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "https://playground.wordpress.net/blueprint-schema.json", - "plugins": [ - "woocommerce", - "email-log" - ], - "extraLibraries": [ - "wp-cli" - ], - "steps": [ - { - "step": "defineWpConfigConsts", - "consts": { - "WP_DEBUG": true, - "WP_CACHE": true - } - }, - { - "step": "activatePlugin", - "pluginName": "WooCommerce", - "pluginPath": "/wordpress/wp-content/plugins/woocommerce" - }, - { - "step": "activatePlugin", - "pluginName": "Email Log", - "pluginPath": "/wordpress/wp-content/plugins/email-log" - }, - { - "step": "installTheme", - "themeData": { - "resource": "url", - "url": "https://downloads.wordpress.org/theme/storefront.zip" - }, - "ifAlreadyInstalled": "skip", - "options": { - "activate": true, - "importStarterContent": false - } - }, - { - "step": "login", - "username": "admin" - } - ] -}