-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (96 loc) · 3.38 KB
/
run_psu_load.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Run psu load test
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run tests against. Allowed values are dev or ref'
required: true
default: 'ref'
maxVusers:
description: 'Maximum number of vusers to create'
required: true
default: '500'
duration:
description: 'The duration to keep creating users for'
required: true
default: '900'
arrivalRate:
description: 'The number of new users to add every second'
required: true
default: '250'
jobs:
run_artillery:
name: Run Artillery
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Show input params
shell: bash
run: |
echo "## maxVusers : ${{ github.event.inputs.maxVusers }}" >> "$GITHUB_STEP_SUMMARY"
echo "## duration : ${{ github.event.inputs.duration }}" >> "$GITHUB_STEP_SUMMARY"
echo "## environment : ${{ github.event.inputs.environment }}" >> "$GITHUB_STEP_SUMMARY"
echo "## arrivalRate : ${{ github.event.inputs.arrivalRate }}" >> "$GITHUB_STEP_SUMMARY"
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Install asdf
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
with:
asdf_branch: v0.14.0
- name: Cache asdf
uses: actions/cache@v4
with:
path: |
~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Install asdf dependencies in .tool-versions
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
with:
asdf_branch: v0.14.0
env:
PYTHON_CONFIGURE_OPTS: --enable-shared
- name: Install Dependencies
run: make install
- name: Assume dev artillery runner role
if: github.event.inputs.environment == 'dev'
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-2
role-to-assume: ${{ secrets.DEV_ARTILLERY_RUNNER_ROLE }}
role-session-name: github-actions-artillery
- name: Assume ref artillery runner role
if: github.event.inputs.environment == 'ref'
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-2
role-to-assume: ${{ secrets.REF_ARTILLERY_RUNNER_ROLE }}
role-session-name: github-actions-artillery
# - name: Run primer load tests
# shell: bash
# env:
# environment: ${{ github.event.inputs.environment }}
# run: |
# ./scripts/run_primer_psu_load_test.sh
- name: Run load tests
shell: bash
env:
maxVusers: ${{ github.event.inputs.maxVusers }}
duration: ${{ github.event.inputs.duration }}
environment: ${{ github.event.inputs.environment }}
arrivalRate: ${{ github.event.inputs.arrivalRate }}
run: |
./scripts/run_psu_load_test.sh
- uses: actions/upload-artifact@v4
if: always()
name: Upload test_report
with:
name: test_report
path: |
psu_load_test.json
psu_load_test.json.html