-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc scenario edits #936
Misc scenario edits #936
Conversation
There's a version of the docs published here: https://mdr-ci.staging.k6.io/docs/refs/pull/936/merge It will be deleted automatically in 30 days. |
- Frame doc in terms of lifecycle functions - Better formatting and spelling
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/04 Arrival Rate.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/04 Arrival Rate.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
Co-authored-by: na-- <n@andreev.sh>
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/04 Arrival Rate.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/04 Arrival Rate.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/04 Arrival Rate.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
- Sequence workload start times | ||
- Add per-scenario tags and environment variables | ||
- Make scenario-specific thresholds. | ||
- Run scenarios in different VU [lifecycle functions](/using-k6/test-lifecycle). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you mean here, sorry 😕 You can't have different setup()
or teardown()
per scenario (see grafana/k6#1638, though it will probably be solved by actually implementing grafana/k6#1342)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now it's not specific enough. Thanks for pointing it out. What about this?
Export multiple scenarios as functions in [VU code](/using-k6/test-lifecycle)
About the strange terminology: a month ago we defined lifecycle function as
a function called in a specific sequence in the k6 runtime.
We changed "callbacks" to "lifecycle functions" because callback sounded like a JS callback. It wasn't so obvious that it was to the Go runtime. Discussion here: #845.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to communicate what is done in this example, by the way.
Different scenarios run different VU logic.
export function contacts() {
http.get('https://test.k6.io/contacts.php', {
tags: { my_custom_tag: 'contacts' },
});
}
export function news() {
http.get('https://test.k6.io/news.php', { tags: { my_custom_tag: 'news' } });
}
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except the minor inline suggestions and questions I left
…s/02 Advanced Examples.md Co-authored-by: na-- <n@andreev.sh>
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
Co-authored-by: na-- <n@andreev.sh>
src/data/markdown/translated-guides/en/02 Using k6/14 Scenarios/02 Advanced Examples.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except the broken list
Co-authored-by: na-- <n@andreev.sh>
Thank you for the detailed review, as always! |
This PR could be rebased. For context, read the commit messages. Each commit is atomic and closes a minor open issue about scenarios.
There's still a good deal of work to do about helping users choose executors, but at least a k6 doc will now appear when someone searches "k6 coordinated omission".
I'm not crazy about the title "Advanced examples," either―what makes them so advanced?―but that can be fixed in a different commit.