From 1ae06b400e2f38534b935bbf65ad9b4301b5f217 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 7 Jan 2025 21:14:37 +0530 Subject: [PATCH 01/15] Create performance-benchmark.yml --- .github/workflows/performance-benchmark.yml | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/performance-benchmark.yml diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml new file mode 100644 index 0000000000..9b74098889 --- /dev/null +++ b/.github/workflows/performance-benchmark.yml @@ -0,0 +1,44 @@ +name: Performance Benchmark + +on: + push: + branches: + - smoke-testing + pull_request: + branches: + - trunk + +jobs: + performance: + name: 'Run tests' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup proper PHP version + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + tools: composer + + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Node install + run: npm ci + + - name: Build + run: npm run build + + - name: Run performance tests + uses: swissspidy/wp-performance-action@v2 + with: + urls: | + / + /wp-admin/ + blueprint: './.github/workflows/performance-blueprint.json' + iterations: 5 + repetitions: 1 From 628b3b0b92cfb170f384d9b68fe730763401e6cf Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 7 Jan 2025 21:15:22 +0530 Subject: [PATCH 02/15] Create performance-blueprint.json --- .github/workflows/performance-blueprint.json | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/performance-blueprint.json diff --git a/.github/workflows/performance-blueprint.json b/.github/workflows/performance-blueprint.json new file mode 100644 index 0000000000..6c6e287538 --- /dev/null +++ b/.github/workflows/performance-blueprint.json @@ -0,0 +1,33 @@ +{ + "$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": "login", + "username": "admin" + } + ] +} From 520f4340e3d982dec49c9d2c5c45e2bd8ee4b451 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 7 Jan 2025 21:24:01 +0530 Subject: [PATCH 03/15] Add storefront theme --- .github/workflows/performance-blueprint.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/performance-blueprint.json b/.github/workflows/performance-blueprint.json index 6c6e287538..1cc090cec6 100644 --- a/.github/workflows/performance-blueprint.json +++ b/.github/workflows/performance-blueprint.json @@ -25,6 +25,18 @@ "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 aff24f6256e22089563be74de8ddaaa31a11eadc Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 7 Jan 2025 21:27:28 +0530 Subject: [PATCH 04/15] Apply suggestions from code review --- .github/workflows/performance-blueprint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-blueprint.json b/.github/workflows/performance-blueprint.json index 1cc090cec6..b2b9900a90 100644 --- a/.github/workflows/performance-blueprint.json +++ b/.github/workflows/performance-blueprint.json @@ -27,7 +27,7 @@ }, { "step": "installTheme", - "themeData": { + "themeZipFile": { "resource": "url", "url": "https://downloads.wordpress.org/theme/storefront.zip" }, From 269c18d3751fe6d789d615c5dbf6a09a93bc4a8c Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 7 Jan 2025 22:51:24 +0530 Subject: [PATCH 05/15] Update .github/workflows/performance-benchmark.yml --- .github/workflows/performance-benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml index 9b74098889..ee04b1bcce 100644 --- a/.github/workflows/performance-benchmark.yml +++ b/.github/workflows/performance-benchmark.yml @@ -34,7 +34,7 @@ jobs: run: npm run build - name: Run performance tests - uses: swissspidy/wp-performance-action@v2 + uses: swissspidy/wp-performance-action@main with: urls: | / From d28c65adfb0bd3153d4452a6aa639c20ccd208ea Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 8 Jan 2025 09:20:51 +0530 Subject: [PATCH 06/15] Update performance-benchmark.yml --- .github/workflows/performance-benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml index ee04b1bcce..9b74098889 100644 --- a/.github/workflows/performance-benchmark.yml +++ b/.github/workflows/performance-benchmark.yml @@ -34,7 +34,7 @@ jobs: run: npm run build - name: Run performance tests - uses: swissspidy/wp-performance-action@main + uses: swissspidy/wp-performance-action@v2 with: urls: | / From aade8eba80156377106198ecd0a338a50f078e67 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 8 Jan 2025 09:26:44 +0530 Subject: [PATCH 07/15] Update performance-blueprint.json --- .github/workflows/performance-blueprint.json | 99 +++++++++++--------- 1 file changed, 56 insertions(+), 43 deletions(-) diff --git a/.github/workflows/performance-blueprint.json b/.github/workflows/performance-blueprint.json index b2b9900a90..707c776752 100644 --- a/.github/workflows/performance-blueprint.json +++ b/.github/workflows/performance-blueprint.json @@ -1,45 +1,58 @@ { - "$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", - "themeZipFile": { - "resource": "url", - "url": "https://downloads.wordpress.org/theme/storefront.zip" - }, - "ifAlreadyInstalled": "skip", - "options": { - "activate": true, - "importStarterContent": false - } - }, - { - "step": "login", - "username": "admin" - } - ] + "$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": "activatePlugin", + "pluginName": "WooCommerce Product Vendors", + "pluginPath": "/wordpress/wp-content/plugins/woocommerce-product-vendors" + }, + { + "step": "installTheme", + "themeZipFile": { + "resource": "url", + "url": "https://downloads.wordpress.org/theme/storefront.zip" + }, + "ifAlreadyInstalled": "skip", + "options": { + "activate": true, + "importStarterContent": false + } + }, + { + "step": "wp-cli", + "command": [ + "term create wcpv_product_vendors 'Vendor' --porcelain", + "eval-file", + "php -r '$term_id = trim(fgets(STDIN)); echo \"term meta set {$term_id} vendor_data '{\\\"email\\\":\\\"sample@example.com\\\"}'\"';'" + ] + }, + { + "step": "login", + "username": "admin" + } + ] } From cd9e05657e76d2c72ede929e770e4485c0155368 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 8 Jan 2025 12:09:43 +0530 Subject: [PATCH 08/15] Update performance-blueprint.json --- .github/workflows/performance-blueprint.json | 103 +++++++++---------- 1 file changed, 47 insertions(+), 56 deletions(-) diff --git a/.github/workflows/performance-blueprint.json b/.github/workflows/performance-blueprint.json index 707c776752..4ca9bf3ee2 100644 --- a/.github/workflows/performance-blueprint.json +++ b/.github/workflows/performance-blueprint.json @@ -1,58 +1,49 @@ { - "$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": "activatePlugin", - "pluginName": "WooCommerce Product Vendors", - "pluginPath": "/wordpress/wp-content/plugins/woocommerce-product-vendors" - }, - { - "step": "installTheme", - "themeZipFile": { - "resource": "url", - "url": "https://downloads.wordpress.org/theme/storefront.zip" - }, - "ifAlreadyInstalled": "skip", - "options": { - "activate": true, - "importStarterContent": false - } - }, - { - "step": "wp-cli", - "command": [ - "term create wcpv_product_vendors 'Vendor' --porcelain", - "eval-file", - "php -r '$term_id = trim(fgets(STDIN)); echo \"term meta set {$term_id} vendor_data '{\\\"email\\\":\\\"sample@example.com\\\"}'\"';'" - ] - }, - { - "step": "login", - "username": "admin" - } - ] + "$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", + "themeZipFile": { + "resource": "wordpress.org/themes", + "slug": "storefront" + }, + "ifAlreadyInstalled": "skip", + "options": { + "activate": true, + "importStarterContent": false + } + }, + { + "step": "runPHP", + "code": "get_error_message();\n} else {\n $term_id = $term['term_id'];\n // Set the term meta for 'vendor_data'\n update_term_meta($term_id, 'vendor_data', json_encode(['email' => 'sample@example.com']));\n echo 'Term created and meta data set successfully.';\n}\n" + }, + { + "step": "login", + "username": "admin" + } + ] } From 6b585484fd4f31ab86740077632d1f5fa95c8a87 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 8 Jan 2025 12:27:35 +0530 Subject: [PATCH 09/15] Update performance-benchmark.yml --- .github/workflows/performance-benchmark.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml index 9b74098889..cd0ba24175 100644 --- a/.github/workflows/performance-benchmark.yml +++ b/.github/workflows/performance-benchmark.yml @@ -2,8 +2,6 @@ name: Performance Benchmark on: push: - branches: - - smoke-testing pull_request: branches: - trunk From 58efb08471b3ac0e4c83fd2124f794ccf6590bc8 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 8 Jan 2025 12:36:31 +0530 Subject: [PATCH 10/15] Update iterations to 10 --- .github/workflows/performance-benchmark.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml index cd0ba24175..7414634d1a 100644 --- a/.github/workflows/performance-benchmark.yml +++ b/.github/workflows/performance-benchmark.yml @@ -1,7 +1,6 @@ name: Performance Benchmark on: - push: pull_request: branches: - trunk @@ -38,5 +37,5 @@ jobs: / /wp-admin/ blueprint: './.github/workflows/performance-blueprint.json' - iterations: 5 + iterations: 10 repetitions: 1 From 5fac8e72ab7e72ef185a76ab5bfe26c461313ee8 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 8 Jan 2025 12:51:34 +0530 Subject: [PATCH 11/15] Revert iterations changes --- .github/workflows/performance-benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml index 7414634d1a..7e51c45ea4 100644 --- a/.github/workflows/performance-benchmark.yml +++ b/.github/workflows/performance-benchmark.yml @@ -37,5 +37,5 @@ jobs: / /wp-admin/ blueprint: './.github/workflows/performance-blueprint.json' - iterations: 10 + iterations: 5 repetitions: 1 From 10f433822a8aa807d2a1bfdab3526600ac55f227 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 27 Jan 2025 20:39:56 +0530 Subject: [PATCH 12/15] Check import data --- .github/workflows/performance-blueprint.json | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/performance-blueprint.json b/.github/workflows/performance-blueprint.json index 4ca9bf3ee2..ffa20c4515 100644 --- a/.github/workflows/performance-blueprint.json +++ b/.github/workflows/performance-blueprint.json @@ -2,7 +2,8 @@ "$schema": "https://playground.wordpress.net/blueprint-schema.json", "plugins": [ "woocommerce", - "email-log" + "email-log", + "https://github.com/woocommerce/wc-smooth-generator/releases/latest/download/wc-smooth-generator.zip" ], "extraLibraries": [ "wp-cli" @@ -15,19 +16,9 @@ "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", - "themeZipFile": { + "themeData": { "resource": "wordpress.org/themes", "slug": "storefront" }, @@ -39,7 +30,19 @@ }, { "step": "runPHP", - "code": "get_error_message();\n} else {\n $term_id = $term['term_id'];\n // Set the term meta for 'vendor_data'\n update_term_meta($term_id, 'vendor_data', json_encode(['email' => 'sample@example.com']));\n echo 'Term created and meta data set successfully.';\n}\n" + "code": "get_error_message();\n} else {\n $term_id = $term['term_id'];\n // Set the term meta for 'vendor_data'\n update_term_meta($term_id, 'vendor_data', json_encode(['email' => 'sample@example.com']));\n echo 'Term created and meta data set successfully.';\n}\n" + }, + { + "step": "wp-cli", + "command": "wp wc generate products 50" + }, + { + "step": "wp-cli", + "command": "wp wc generate orders 20" + }, + { + "step": "wp-cli", + "command": "wp wc generate customers 10" }, { "step": "login", From cf6b29c5f412f00733b3fc5d73e592493e0aa6a1 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 28 Jan 2025 10:19:51 +0530 Subject: [PATCH 13/15] Add product_cat --- .github/workflows/performance-blueprint.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/performance-blueprint.json b/.github/workflows/performance-blueprint.json index ffa20c4515..a0ffeca35e 100644 --- a/.github/workflows/performance-blueprint.json +++ b/.github/workflows/performance-blueprint.json @@ -44,6 +44,10 @@ "step": "wp-cli", "command": "wp wc generate customers 10" }, + { + "step": "wp-cli", + "command": "wp wc generate terms product_cat 100" + }, { "step": "login", "username": "admin" From 5ed20eac9ea855ff3375cd4dd2de94095687a248 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 28 Jan 2025 14:09:01 +0530 Subject: [PATCH 14/15] Apply suggestions from code review --- .github/workflows/performance-benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml index 7e51c45ea4..c211c5a9d7 100644 --- a/.github/workflows/performance-benchmark.yml +++ b/.github/workflows/performance-benchmark.yml @@ -31,7 +31,7 @@ jobs: run: npm run build - name: Run performance tests - uses: swissspidy/wp-performance-action@v2 + uses: swissspidy/wp-performance-action@main with: urls: | / From 8cfd88f2413849fe6b1e39f433a506b6aea76e29 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 28 Jan 2025 15:52:17 +0530 Subject: [PATCH 15/15] Revert --- .github/workflows/performance-benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmark.yml b/.github/workflows/performance-benchmark.yml index c211c5a9d7..7e51c45ea4 100644 --- a/.github/workflows/performance-benchmark.yml +++ b/.github/workflows/performance-benchmark.yml @@ -31,7 +31,7 @@ jobs: run: npm run build - name: Run performance tests - uses: swissspidy/wp-performance-action@main + uses: swissspidy/wp-performance-action@v2 with: urls: | /