Locust Load Test #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Locust Load Test | |
on: | |
workflow_dispatch: | |
inputs: | |
product: | |
type: choice | |
description: 'Name of the product to test' | |
required: true | |
options: | |
- agora | |
- openchallenges | |
# user_count: | |
# description: 'Number of users to simulate in Locust' | |
# required: true | |
# default: '50' | |
# spawn_rate: | |
# description: 'Rate at which users are spawned (users per second)' | |
# required: true | |
# default: '10' | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04-4core-16GBRAM-150GBSSD | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v4 | |
- name: Set up the dev container | |
uses: ./.github/actions/setup-dev-container | |
# - name: Build the specified product, serve it, and perform a load test | |
# run: | | |
# devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \ | |
# && nx run-many --target=build-image --projects=${{ inputs.product }}-*" \ | |
# && nx serve-detach ${{ inputs.product }}-apex \ | |
# && nx serve sandbox-locust --configuration=${{ inputs.product }} | |
- name: Perform a load test | |
run: | | |
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \ | |
&& nx run sandbox-locust:serve:${{ inputs.product }} --headless | |
- name: Upload Locust reports as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: locust-reports | |
path: apps/sandbox/locust/locust_*.csv |