Skip to content

Conversation

@asos-benpearson
Copy link

Allow for load scenario to be defined within the K6 script as well as in the Taurus yml file. Currently if no iterations is defined in the Taurus scenario then only 1 iteration is executed before the test ends. This change adds k6 its own get-load method to allow for infinite iterations.

Closes #1791

@codecov
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.86%. Comparing base (dce2ffa) to head (ef851b4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1797      +/-   ##
==========================================
+ Coverage   89.84%   89.86%   +0.03%     
==========================================
  Files          71       71              
  Lines       19597    19631      +34     
==========================================
+ Hits        17604    17639      +35     
+ Misses       1993     1992       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asos-benpearson
Copy link
Author

Hi, I have fixed up the tests and improved code coverage. All checks are now passing, thanks.

@asos-benpearson
Copy link
Author

Can someone please review this? Thanks

@asos-benpearson
Copy link
Author

Hi, are any maintainers able to review this PR please?

@aldrichksb
Copy link

Any maintainers able to review this PR please?

Copy link

@asos-gal-onbroner asos-gal-onbroner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed changes and tested changes in local environment.


def startup(self):
cmdline = [self.k6.tool_name, "run", "--out", f"csv={self.kpi_file}"]
cmdline = [self.k6.tool_name, "run"] #, "--out", f"csv={self.kpi_file}"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks Taurus' handling of K6 results when more than one scenario is executed in parallel.

In the previous version, Taurus managed the creation of files like kpi-1.csv, kpi-2.csv, etc. automatically.
With this change, we now have to manually configure this setup.

Error:
Child Process Error: Empty results, most likely xxx (K6Executor) failed. Actual reason for this can be found in logs under...

(but the execution was a success. However, due to this error status, the execution is considered a failure in the pipeline)

For a complex execution involving multiple scenarios running in parallel, this increases the complexity of the user's code for something that was previously managed internally.

Therefore, I’d like to understand the reasoning behind removing this default functionality, if possible. Thank you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah Im aware of this. However, this PR has been raised for over a year with no communication from the project maintainers at all so we have been using this Fork instead. We decided we dont need the results output to file as we output to an InfluxDB instead and we dont care about the overall Taurus result so this 'quick' fix works for us.

If this is going to be seriously considered for merging then Ill spend some more time looking at it but Im not sure the project maintainers are interested.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aldrichksb this has now been made optional. Disabled via the modifications -> disable block inside the scenarios block.

@asos-benpearson
Copy link
Author

Just keeping this updated with main

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.

K6 Executor: Scenario defined within K6 .js only executing 1 iteration

5 participants