-
Notifications
You must be signed in to change notification settings - Fork 8
53 lines (47 loc) · 1.47 KB
/
load-test.yaml
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
name: load-test
permissions: {}
on:
pull_request:
branches:
- 'main'
- 'add_threshold'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-load-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup build env
uses: ./.github/actions/setup-test-env
timeout-minutes: 10
- name: Wait for kyverno ready
uses: ./.github/actions/kyverno-wait-ready
- name: Run local k6 test
shell: bash
run: |
cd k6
export VUS=10
export ITERATIONS=1000
export SCRIPT=kyverno-pss.js
./start.sh tests/$SCRIPT $VUS $ITERATIONS
grep "level=error" "$SCRIPT-$VUSvu-$ITERATIONSit-logs.txt"
# Store the exit code of the grep command
exit_code=$?
# Check if the exit code is 0 (match found) or 1 (no match found)
if [ $exit_code -eq 0 ]; then
echo "Error found in the file."
exit 1
elif [ $exit_code -eq 1 ]; then
echo "No error found in the file."
exit 0
else
echo "An error occurred while searching the file."
exit 1
fi
cat kyverno-pss.js-10vu-1000it-logs.txt
# uses: grafana/[email protected]
# with:
# filename: k6/tests/kyverno-pss.js 10 100