Skip to content

Commit

Permalink
action for scheduled and ondemand execution
Browse files Browse the repository at this point in the history
  • Loading branch information
dagfinno committed Sep 26, 2024
1 parent c0482b4 commit 3563e29
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/taxreport-loadtest-ondemand.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
name: k6 Load Test
name: taxreport loadtest ondemand

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
vus:
description: 'Number of VUS'
required: true
default: 10
type: number
duration:
description: 'duration of test, ie 30s, 1m, 10m'
required: true
type: string
limit:
description: 'Limit the number of tokens to generate'
required: true
default: 10
type: number
jobs:
run-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -29,6 +45,7 @@ jobs:
env: ${{ secrets.YTENVIRONMENT }}
tokengenuser: ${{ secrets.TOKENGENUSER }}
tokengenuserpwd: ${{ secrets.TOKENGENPWD }}
limit: ${{ inputs.limit }}

- name: Setup K6
uses: grafana/setup-k6-action@v1
Expand All @@ -37,7 +54,7 @@ jobs:
uses: grafana/run-k6-action@v1
with:
path: performance-tests/tax-report/src/tax-report.js
flags: --vus=40 --duration=10m
flags: --vus=${{ inputs.vus }} --duration=${{ inputs.duration }}
env:
K6_WEB_DASHBOARD: true
K6_WEB_DASHBOARD_EXPORT: html-report.html
Expand Down Expand Up @@ -67,7 +84,7 @@ jobs:
if: always()
shell: bash
run: |
REPORT_DIR='taxreports'
REPORT_DIR='taxreports_ondemand'
azcopy cp --recursive "*.html" "https://altinnloadtests.blob.core.windows.net/\$web/$REPORT_DIR"
azcopy cp --recursive "stdout.txt" "https://altinnloadtests.blob.core.windows.net/\$web/$REPORT_DIR"
echo "::Link to test results summary: title=HTML report url::https://altinnloadtests.z1.web.core.windows.net/$REPORT_DIR/summary.html"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/taxreport-loadtest-push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: k6 Load Test
name: taxreport loadtest smoketest

on:
push:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/taxreport-loadtest-schedule.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: k6 Load Test
name: taxreport loadtest scheduled

on:
schedule:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
if: always()
shell: bash
run: |
REPORT_DIR='taxreports'
REPORT_DIR='taxreports_scheduled'
azcopy cp --recursive "*.html" "https://altinnloadtests.blob.core.windows.net/\$web/$REPORT_DIR"
azcopy cp --recursive "stdout.txt" "https://altinnloadtests.blob.core.windows.net/\$web/$REPORT_DIR"
echo "::Link to test results summary: title=HTML report url::https://altinnloadtests.z1.web.core.windows.net/$REPORT_DIR/summary.html"
Expand Down

0 comments on commit 3563e29

Please sign in to comment.