Skip to content

Commit c4fad9f

Browse files
feat: feat: k6 load-spike ramp profile for plans read path
1 parent 2ab2026 commit c4fad9f

1 file changed

Lines changed: 32 additions & 40 deletions

File tree

Lines changed: 32 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
1-
name: K6 Spike Test - Plans
2-
3-
on:
4-
workflow_dispatch:
5-
inputs:
6-
environment:
7-
description: 'Test environment'
8-
required: true
9-
default: 'staging'
10-
type: choice
11-
options:
12-
- staging
13-
- production
14-
15-
jobs:
16-
spike-test:
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: actions/checkout@v4
20-
21-
- name: Setup k6
22-
run: |
23-
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
24-
echo "deb https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6-stable.list
25-
sudo apt-get update
26-
sudo apt-get install -y k6
27-
28-
- name: Run Spike Test
29-
env:
30-
BASE_URL: ${{ secrets[format('K6_{0}_BASE_URL', github.event.inputs.environment)] }}
31-
API_KEY: ${{ secrets[format('K6_{0}_API_KEY', github.event.inputs.environment)] }}
32-
run: |
33-
k6 run tests/k6/plans-spike.js --out=json=results.json
34-
35-
- name: Upload JSON Summary
36-
if: always()
37-
uses: actions/upload-artifact@v4
38-
with:
39-
name: k6-spike-results
40-
path: results.json
1+
name: k6 Spike Test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- 'tests/k6/**'
8+
- '.github/workflows/k6-spike-test.yml'
9+
10+
jobs:
11+
spike:
12+
name: Plans read-path spike (10 -> 2000 VUs)
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Run k6 spike profile
18+
uses: grafana/k6-action@v0.3.1
19+
with:
20+
filename: tests/k6/plans-spike.js
21+
flags: --summary-export=results/k6-spike-summary.json
22+
env:
23+
BASE_URL: ${{ secrets.STAGING_URL }}
24+
API_KEY: ${{ secrets.STAGING_API_KEY }}
25+
26+
- name: Publish JSON summary artifact
27+
uses: actions/upload-artifact@v4
28+
if: always()
29+
with:
30+
name: k6-spike-summary
31+
path: results/k6-spike-summary.json
32+
if-no-files-found: warn

0 commit comments

Comments
 (0)