Skip to content

Conversation

@sethidden
Copy link
Contributor

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.

'@vue-storefront/eslint-config-jest',
],
globals: {
"__ENV": "readonly",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid no-undef eslint error

@sethidden sethidden force-pushed the M2-899-k6-gh-actions branch from 9e043ed to 9a7d310 Compare June 29, 2022 13:28
@sethidden
Copy link
Contributor Author

@Frodigo given the tests are pretty ugly because of graphql maybe I could push a PR with just a sample test that queries the environment base url? Like a k6 "hello world"? That way the workflow part would be merged at least.

@sethidden sethidden force-pushed the M2-899-k6-gh-actions branch 2 times, most recently from b67d6c5 to f30fb18 Compare June 30, 2022 10:58
@sethidden sethidden marked this pull request as ready for review June 30, 2022 11:10
Frodigo
Frodigo previously approved these changes Jun 30, 2022
Copy link
Contributor

@Frodigo Frodigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one question, something good to have.

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
@sethidden sethidden changed the title test(load): add K6 load test workflow with example test test(load): add K6 load test workflow with example tests Jun 30, 2022
@sethidden sethidden merged commit 54ff69e into develop Jun 30, 2022
@sethidden sethidden deleted the M2-899-k6-gh-actions branch June 30, 2022 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants