-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
Description
Prerequisites
- I am using the latest version of Locust
- I am suggesting a new feature, not asking a question
Description
Hi!
I propose the creation of an official or community-supported GitHub Action to simplify running Locust tests within CI/CD pipelines. This would abstract away the manual steps of setting up Python, installing dependencies, and running the locust command.
A great example of it is Grafana k6's GitHub Action (https://github.com/grafana/run-k6-action).
I suggest similar action for Locust, let's call it run-locust-action. A user's workflow could look like this:
on:
push:
jobs:
locust-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Locust test
uses: locustio/run-locust-action@v1
with:
# Required inputs
locust-file: 'tests/my_locust_file.py'
host: 'https://my-staging-app.com'
# Optional inputs for load configuration
users: 50
spawn-rate: 10
run-time: '2m'
# Optional inputs for pass/fail criteria
check-fail-ratio: 0.02 # Fail if error rate > 2%
check-avg-response-time: 500 # Fail if avg response time > 500ms
# Optional: Automatically upload HTML/CSV reports as artifacts
upload-artifacts: trueI'd love to hear your thoughts on this proposal. I'm also willing to help with the implementation if the team finds this idea valuable.
ionutab