Created
November 30, 2023 10:41
-
-
Save iamsuneeth/9de8963bf31e7dd008cd1f598b0d1cbf to your computer and use it in GitHub Desktop.
This file contains hidden or 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: Artillery performance test | |
on: | |
workflow_dispatch: | |
inputs: | |
startup_duration: | |
description: 'Start up duration' | |
required: true | |
default: 20 | |
type: 'number' | |
startup_arrival_rate: | |
description: 'Start up arrival rate' | |
required: true | |
default: 5 | |
type: 'number' | |
startup_max_users: | |
description: 'Start up max users' | |
required: true | |
default: 30 | |
type: 'number' | |
peak_duration: | |
description: 'Peak duration' | |
required: true | |
default: 5 | |
type: 'number' | |
peak_arrival_rate: | |
description: 'Peak arrival rate' | |
required: true | |
default: 20 | |
type: 'number' | |
peak_max_users: | |
description: 'Peak max users' | |
required: true | |
default: 30 | |
type: 'number' | |
slowdown_duration: | |
description: 'Slow down duration' | |
required: true | |
default: 10 | |
type: 'number' | |
slowdown_arrival_rate: | |
description: 'Slow down arrival rate' | |
required: true | |
default: 2 | |
type: 'number' | |
slowdown_max_users: | |
description: 'Slow down max users' | |
required: true | |
default: 30 | |
type: 'number' | |
environment: | |
description: 'Environment to use for load testing' | |
required: true | |
default: 'staging' | |
jobs: | |
artillery: | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{ inputs.environment }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
registry-url: https://registry.npmjs.org/ | |
cache: 'npm' | |
- run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Execute load tests | |
uses: artilleryio/action-cli@v1 | |
with: | |
command: run layout-config.yml --output ./report.json | |
working-directory: tests/performance | |
env: | |
SERVICE_URL: ${{ vars.SERVICE_URL }} | |
SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }} | |
TEST_STARTUP_DURATION: ${{ inputs.startup_duration }} | |
TEST_STARTUP_ARRIVAL_RATE: ${{ inputs.startup_arrival_rate }} | |
TEST_STARTUP_MAX_USERS: ${{ inputs.startup_max_users}} | |
TEST_PEAK_DURATION: ${{ inputs.peak_duration }} | |
TEST_PEAK_ARRIVAL_RATE: ${{ inputs.peak_arrival_rate }} | |
TEST_PEAK_MAX_USERS: ${{ inputs.peak_max_users }} | |
TEST_SLOWDOWN_DURATION: ${{ inputs.slowdown_duration }} | |
TEST_SLOWDOWN_ARRIVAL_RATE: ${{ inputs.slowdown_arrival_rate }} | |
TEST_SLOWDOWN_MAX_USERS: ${{ inputs.slowdown_max_users }} | |
DEBUG: 'http:response' | |
- name: Upload report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artillery-report | |
path: ./tests/performance/report.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment