Skip to content

Commit

Permalink
setting name for test run in k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
dagfinno committed Jan 24, 2025
1 parent dc1c3cb commit b82c6d1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/workflow-run-k6-ci-cd-yt01.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run K6 performance tests ci/cd yt01

on:
workflow_call:
inputs:
apiVersion:
required: true
type: string
environment:
required: true
type: string
testSuitePath:
required: true
type: string
vus:
required: true
type: number
duration:
required: true
type: string
secrets:
TOKEN_GENERATOR_USERNAME:
required: true
TOKEN_GENERATOR_PASSWORD:
required: true
jobs:
k6-test:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
checks: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup k6
uses: grafana/setup-k6-action@v1
- name: Run K6 tests (${{ inputs.testSuitePath }})
run: |
echo "Running k6 test suite ${{ inputs.testSuitePath }} with ${{ inputs.vus }} VUs for ${{ inputs.duration }}"
k6 run ${{ inputs.testSuitePath }} --quiet --log-output=stdout --include-system-env-vars \
--vus=${{ inputs.vus }} --duration=${{ inputs.duration }} --out csv=./results.csv
grep http_req_duration ./results.csv | sort --field-separator=',' --key=3 -nr | head -10
env:
API_ENVIRONMENT: ${{ inputs.environment }}
API_VERSION: ${{ inputs.apiVersion }}
TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }}
6 changes: 2 additions & 4 deletions .github/workflows/workflow-run-k6-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ jobs:
- name: Run K6 tests (${{ inputs.testSuitePath }})
run: |
echo "Running k6 test suite ${{ inputs.testSuitePath }} with ${{ inputs.vus }} VUs for ${{ inputs.duration }}"
# k6 run ${{ inputs.testSuitePath }} --quiet --log-output=stdout --include-system-env-vars \
# --vus=${{ inputs.vus }} --duration=${{ inputs.duration }} --out csv=./results.csv
testSuiteFileName=$(basename "${{ inputs.testSuitePath }}")
echo "Running test suite $testSuiteFileName"
./tests/k6/tests/scripts/run-test-in-k8s.sh -f ${{ inputs.testSuitePath }} -c k6-enduser-search -n k6-enduser-search -v ${{ inputs.vus }} -d ${{ inputs.duration }} -p ${{ inputs.parallelism }}
#grep http_req_duration ./results.csv | sort --field-separator=',' --key=3 -nr | head -10
env:
API_ENVIRONMENT: ${{ inputs.environment }}
API_VERSION: ${{ inputs.apiVersion }}
Expand Down

0 comments on commit b82c6d1

Please sign in to comment.