-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.33 KB
/
faucet_load_test.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
name: Faucet Load Test
on:
push:
branches:
- faucet-load
workflow_dispatch:
inputs:
host:
description: 'Target host'
required: true
default: 'https://odyssey.faucet.story.foundation'
number-of-users:
description: 'Number of users(peak concurrency)'
required: true
default: '100'
ramp-up:
description: 'Ramp up (users started/second)'
required: true
default: '2'
run_time:
description: 'Run time (e.g. 20, 20s, 3m, 2h, etc.)'
required: true
default: '1m'
jobs:
load-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
npm install
- name: Set Timestamp
id: set_timestamp
run: |
TIMESTAMP=$(date +'%Y%m%d_%H%M%S')
echo "timestamp=$TIMESTAMP" >> $GITHUB_OUTPUT
- name: Create Test Wallets
id: generate_wallets
run: |
num_users=${{ github.event.inputs.number-of-users }}
total_users=$((num_users * 100))
npx ts-node src/faucet/generate_wallet_address.ts $total_users
- name: Run Locust
run: |
rm -rf ./test_report/*
locust -f faucet/test_faucet_api.py --headless -u ${{ github.event.inputs.number-of-users }} -r ${{ github.event.inputs.ramp-up }} --run-time ${{ github.event.inputs.run_time }} --host ${{ github.event.inputs.host }} --html ./test_report/faucet-load-test-report_${{ steps.set_timestamp.outputs.timestamp }}.html
continue-on-error: true
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./test_report
publish_branch: gh-pages
keep_files: true
- name: Upload Test Report
if: always()
uses: actions/upload-artifact@v4
with:
name: hub-load-test-report
path: |
./test_report