Skip to content
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

Merged
merged 17 commits into from
Dec 19, 2022
Merged

Misc scenario edits #936

merged 17 commits into from
Dec 19, 2022

Conversation

MattDodsonEnglish
Copy link
Contributor

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.

- General edits and sentence shortening
- mention coordinated omission to close #231
- Add a bit more context and explanation
- Use verbs in headings
- Specifically say sequence to fix #444
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

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
- 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).
Copy link
Member

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)

Copy link
Contributor Author

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.

Copy link
Contributor Author

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' } });
}

Copy link
Member

@na-- na-- left a 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

MattDodsonEnglish and others added 2 commits December 15, 2022 12:24
Co-authored-by: na-- <n@andreev.sh>
…s/02 Advanced Examples.md

Co-authored-by: na-- <n@andreev.sh>
@na-- na-- mentioned this pull request Dec 16, 2022
3 tasks
Co-authored-by: na-- <n@andreev.sh>
Copy link
Member

@na-- na-- left a 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>
@MattDodsonEnglish
Copy link
Contributor Author

Thank you for the detailed review, as always!

@MattDodsonEnglish MattDodsonEnglish merged commit b6fd4bb into main Dec 19, 2022
@MattDodsonEnglish MattDodsonEnglish deleted the misc-scenario-edits branch December 19, 2022 13:26
@MattDodsonEnglish MattDodsonEnglish mentioned this pull request Jan 16, 2023
4 tasks
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.

2 participants