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

Add examples for scenario reuse #255

Open
na-- opened this issue Apr 5, 2021 · 2 comments
Open

Add examples for scenario reuse #255

na-- opened this issue Apr 5, 2021 · 2 comments
Labels
Area: OSS Content Improvements or additions to community/oss documentation examples Issues about a missing example Type: needsMaintainerHelp Good issue for k6 maintainers

Comments

@na--
Copy link
Member

na-- commented Apr 5, 2021

It seems like with scenarios, people want to put different scenarios in different files and execute them separately, but also execute all of them at once. The requisite k6 issue for making this use case better is grafana/k6#1342, but even now, people can achieve a lot by just having a main file that imports and re-exports individual scenarios. Recent examples where this has popped up:

@na-- na-- changed the title Add examples for code reuse Add examples for scenario reuse Apr 5, 2021
@simskij
Copy link
Contributor

simskij commented Apr 23, 2021

Good idea! We need more content around test project organization in general as almost all examples we currently have are single-file ones.

@simskij simskij added Area: OSS Content Improvements or additions to community/oss documentation Priority: Medium labels Apr 23, 2021
@na--
Copy link
Member Author

na-- commented Apr 23, 2021

Here is another recent example of a similar question: https://community.k6.io/t/to-have-a-shared-project-for-a-company-with-multiple-teams/1653

And a more complicated use case where someone had to wrap handleSummary() of a generic script but leave everything else the same: grafana/k6#1946

This latter case is interesting because I had to drop down to ES5.1, since the way k6 implements the ES6 export and import prevented me from using them instead of the ES5.1 require() and exports. So this might be worth documenting instead.

@ppcano ppcano added the Type: needsMaintainerHelp Good issue for k6 maintainers label Sep 20, 2021
@MattDodsonEnglish MattDodsonEnglish added examples Issues about a missing example and removed Priority: Medium labels Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: OSS Content Improvements or additions to community/oss documentation examples Issues about a missing example Type: needsMaintainerHelp Good issue for k6 maintainers
Projects
None yet
Development

No branches or pull requests

4 participants