Skip to content

Official GitHub Action for running Locust tests #3233

@ta4ilka69

Description

@ta4ilka69

Prerequisites

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: true

I'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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions