-
Notifications
You must be signed in to change notification settings - Fork 50
Support For URL Grouping? #114
Comments
@dvngnt If you use the folders in Postman, postman-to-k6 will generate the script in "groups" based on the folders. |
Thanks for the solutions @thim81 ; I didn't know about the folder to group option. This will be useful when the requests are consecutive. The other instance I was thinking about is say I have requests A, B, C. Requests A and C should be grouped, but not B. Is it possible to surround A and C with the same group value for k6 to aggregate? |
If you organise them like that in Postman, they will be grouped like that in K6. the postman-to-k6 package converts your Postman collection into a K6 script. If you use --seperate parameter (https://github.com/k6io/postman-to-k6#separate) The package will create seperate scripts per postman request, in seperate files. @simskij did a great job when creating this package since it is really powerful and flexible for converting your postman to K6. |
@thim81 I'm currently working with the split output. I see that it's possible to surround requests with a group inside the default function. This is a workable solution Thank you!, but it might more modular for the data to live in the request itself. Do you know if it's possible to add that tag/group to the individual request.js file something like https://k6.io/docs/using-k6/http-requests/#url-grouping |
Could you share what you want to do with it? So that I can beter understand the use-case? Is the tagging for reporting purposes? Or for something else? |
The application I'm testing has a few APIs that will call every 30 sec. It's the exact same request so I duplicate the request in postman and place it throughout the collection. When I covert the collection to a k6 script, it would be cool to have that duplicated request be a part of its own group. One possible way might be surrounding the call with a group whenever the request is called, but it might be more efficient to add that group or tag to the request itself. so the actual k6 script is cleaner. The next step would include removing the duplicate requests.js and just call the first one, but that's a separate code cleaning issue. |
@thim81 folders kinda work, but if you have the same request multiple folders they get grouped together, and maybe on one level they should, but it would be nice to have a tag that works across groups for metrics. |
@dvngnt Since postman-to-k6 is based on the Postman collection data, what would you use within the Postman collection to base your tag.name on? What would you expect as K6 tag:
We have in Postman the following info available:
There is no option to "tag" a request with metadata in Postman, so we have to find a useful convention. Request name or request path seem very logical, resulting in a K6 tag like so:
|
@thim81 good point, postman doesn't have a great tagging solution for k6 to plug into. I'm managing with the folder solution. Thanks |
@dvngnt I m looking to create a PR to have some sort or K6 tag generation in place in K6, for reporting grouping. Your use-case was more around request organisation? Or also for reporting? |
@thim81 i would say more for reporting. Groups and folders seem to work well for organizations. There are times where a request might be /user/userId where id is some unique integer and k6 complains about too many metrics and will suggest URL grouping. Which I don't believe folders will solve. |
@dvngnt it matches with my reporting use-case. would you consider any of the following info available in Postman, as useful for a k6 reporting tag?
or something else? |
@thim81 I'm thinking the request name is the most useful. I think by default users will give a request a name before creating a folder. |
In the meantime, I faced the same issue and some others (#125). After some thought, I found a way and created a PR and a forked NPM package version that contains the feature to set K6 request tags. Have a look at readme: https://www.npmjs.com/package/@apideck/postman-to-k6#k6-request-tag that explains how to use it. Replace in your packages.json:
to
|
There are instances where identical requests or similar requests should be grouped, e.g., Logging in.
I'm not aware of a way to add this metadata to postman or a converted script, but It would be a great QoL feature for running k6 in the cloud.
The text was updated successfully, but these errors were encountered: