From 080f966b93bdb9b19d63866c3cac866ad64a33f5 Mon Sep 17 00:00:00 2001 From: Tam Mullen Date: Fri, 6 Aug 2021 12:46:53 +0100 Subject: [PATCH] Updated k6 tests based on feedback --- tests/performance/config.js | 2 +- tests/performance/headers.js | 2 +- .../requests/merchant/home-wc-admin.js | 4 ++-- tests/performance/tests/checkout-spike.js | 24 ------------------- 4 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 tests/performance/tests/checkout-spike.js diff --git a/tests/performance/config.js b/tests/performance/config.js index 38dbde52cd1..3a549193fae 100644 --- a/tests/performance/config.js +++ b/tests/performance/config.js @@ -38,7 +38,7 @@ export const product_url = __ENV.P_URL || 'beanie'; export const product_id = __ENV.P_ID || '13'; export const product_search_term = __ENV.P_TERM || 'beanie'; -export const coupon_code = 'testing'; +export const coupon_code = __ENV.P_COUPON || 'testing'; export const add_product_title = 'Test Product'; export const add_product_regular_price = '12'; diff --git a/tests/performance/headers.js b/tests/performance/headers.js index e513501170f..b73fda1b72b 100644 --- a/tests/performance/headers.js +++ b/tests/performance/headers.js @@ -67,7 +67,7 @@ export { commonRequestHeaders, commonGetRequestHeaders, commonAPIGetRequestHeaders, - contentTypeRequestHeader, + contentTypeRequestHeader, commonPostRequestHeaders, commonNonStandardHeaders, }; diff --git a/tests/performance/requests/merchant/home-wc-admin.js b/tests/performance/requests/merchant/home-wc-admin.js index 4e0a883ac28..653961df4c0 100644 --- a/tests/performance/requests/merchant/home-wc-admin.js +++ b/tests/performance/requests/merchant/home-wc-admin.js @@ -153,8 +153,8 @@ export function homeWCAdmin() { ); response = http.get( - `${base_url}/wp-json/wc-analytics/products?page=1&per_page=1&low_in_stock=true&` + - `status=publish&_fields%5B0%5D=id&_locale=user`, + `${base_url}/wp-json/wc-analytics/products/low-in-stock?page=1&per_page=1&` + + `low_in_stock=true&status=publish&_fields%5B0%5D=id&_locale=user`, { headers: requestHeaders, } diff --git a/tests/performance/tests/checkout-spike.js b/tests/performance/tests/checkout-spike.js deleted file mode 100644 index a3cec7a5240..00000000000 --- a/tests/performance/tests/checkout-spike.js +++ /dev/null @@ -1,24 +0,0 @@ -import { cart } from '../requests/shopper/cart.js'; -import { checkoutGuest } from '../requests/shopper/checkout-guest.js'; - -export let options = { - scenarios: { - checkoutFlowSpike: { - executor: 'ramping-arrival-rate', - startRate: 1, - timeUnit: '1s', - preAllocatedVUs: 1, - maxVUs: 4, - stages: [ - { target: 3, duration: '30s' }, - { target: 0, duration: '30s' }, - ], - exec: 'checkoutGuestFlow', - }, - }, - }; - -export function checkoutGuestFlow() { - cart(); - checkoutGuest(); -}