-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(load): add K6 load test workflow with example test
This commit adds a GitHub Actions workflow (you have to *manually* trigger it) that uses the K6 load testing utillity to run tests on a given environment. I had to add the `K6_API_TOKEN` secret to GitHub to allow running the tests in K6's cloud (VSF has a paid plan). You can also run the test on GitHub's agent though. M2-899 fix: use js, not ts file chore: partially revert #1107 This reverts commit 9b8de85. This change was made because K6 recorded tests are gigantic when customQuery sends the GraphQL AST in the request body. After this change, this the request is sent in string form, but is converted into GraphQL AST on the middleware side (because Apollo GraphQL client expects AST (DocumentNode TS type), not string) test(load): improve gql requests refactor: fix newlines
- Loading branch information
Showing
17 changed files
with
438 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Run K6 test file | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
cloud: | ||
description: True = run in K6 cloud; False = run on the test on GitHub Actions agent | ||
required: true | ||
default: false | ||
type: boolean | ||
|
||
filename: | ||
description: The K6 test file to run relative to repository root | ||
required: true | ||
default: packages/theme/tests/load/searchProduct.js | ||
type: string | ||
|
||
environment: | ||
description: The full URL of the environment on which load tests will be ran | ||
required: true | ||
default: https://demo-magento2-canary.europe-west1.gcp.storefrontcloud.io | ||
type: choice | ||
options: | ||
- https://demo-magento2-canary.europe-west1.gcp.storefrontcloud.io | ||
- https://demo-magento2-dev.europe-west1.gcp.storefrontcloud.io | ||
- https://demo-magento2.europe-west1.gcp.storefrontcloud.cloud | ||
- https://demo-magento2-enterprise.europe-west1.gcp.storefrontcloud.io | ||
|
||
flags: | ||
description: Additional argument and flags to provide to the k6 CLI. See https://k6.io/docs/using-k6/options for details. | ||
required: false | ||
default: '' | ||
type: string | ||
|
||
jobs: | ||
build: | ||
name: Run k6 cloud test | ||
runs-on: ubuntu-latest | ||
environment: test | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run k6 cloud test | ||
uses: grafana/k6-action@v0.2.0 | ||
with: | ||
cloud: ${{ inputs.cloud }} | ||
token: ${{ secrets.K6_CLOUD_API_TOKEN }} | ||
filename: ${{ inputs.filename }} | ||
flags: ${{ inputs.flags }} | ||
env: | ||
BASE_URL: ${{ inputs.environment }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
packages/theme/components/TopBar/checkStoresAndCurrency.gql.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
packages/theme/modules/catalog/category/components/cms/categoryContent.gql.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...eme/modules/catalog/category/components/filters/command/getProductFilterByCategory.gql.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
packages/theme/modules/catalog/category/composables/useFacet/getFacetData.gql.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.