k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Sending summary to remote endpoint

Open ameetpal opened this issue 1 year ago • 4 comments
trafficstars

Feature Description

Hey,

Our team is providing k6 testing as a platform in our org and other teams use our platform to test their services. To collect the test result summary, we are exposing an endpoint and in test scripts we have to overide the handleSummery function and write the code to send it to a server. As indicated in K6 docs https://k6.io/docs/results-output/end-of-test/custom-summary/#example-send-data-to-remote-server

However, every test script have to export handleSummary function, So we were looking into the solution were we can provide a default behaviour for sending the summary data.

We have already raised this issue in Grafana community and we were suggested to listen to Event in custom K6 extension, so we are currently working making a new extension for this and will be release this for public use also. https://community.grafana.com/t/exploring-direct-event-consumption-in-k6-seeking-alternatives-to-handlesummary-override/116038

However, after looking into the code, we found out that there is no event with summary data

Suggested Solution (optional)

So to get summary data in event we have created a new event TestSummaryGenerated, which our extension will listen to. I have already raised a PR for this, please review it and let me know if any additional change is required

PR:- https://github.com/grafana/k6/pull/3682

Already existing or connected issues / PRs (optional)

https://github.com/grafana/k6/pull/3682

ameetpal avatar Apr 10 '24 11:04 ameetpal

hi, any update here ?

ameetpal avatar Apr 18 '24 05:04 ameetpal

any update here ?

ameetpal avatar Apr 22 '24 05:04 ameetpal

Hey @ameetpal,

To collect the test result summary

in alternative to the other already proposed options, this is one of the reasons why Grafana Cloud k6 exists, did you give it a try?

codebien avatar Apr 23 '24 09:04 codebien

yes, those options will not work for us

ameetpal avatar Apr 24 '24 05:04 ameetpal

Closing because the related pull request has been merged and the new event will be available in k6 v0.51.0

codebien avatar May 03 '24 16:05 codebien