-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add_threshold' of https://github.com/kyverno/load-testing…
… into add_threshold
- Loading branch information
Showing
2 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,21 @@ concurrency: | |
jobs: | ||
run-load-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
vus: | ||
- name: vu | ||
values: | ||
- 1000 | ||
iterations: | ||
- name: iteration | ||
values: | ||
- 1000 | ||
scripts: | ||
- name: script | ||
values: | ||
- kyverno-pss.js | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
|
@@ -26,28 +41,20 @@ jobs: | |
- 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-${VUS}vu-${ITERATIONS}it-logs.txt" | ||
# Store the exit code of the grep command | ||
exit_code=$? | ||
export VUS=${{ join(matrix.vus.values, ',') }} | ||
export ITERATIONS=${{ join(matrix.iterations.values, ',') }} | ||
export SCRIPT=${{ join(matrix.scripts.values, ',') }} | ||
make kyverno-pss-block | ||
cat ${SCRIPT}-${VUS}vu-${ITERATIONS}it-logs.txt | ||
- name: Check errors: | ||
shell: bash | ||
run: | | ||
make check-error | ||
# - name: Debug | ||
# if: failure() | ||
# run: | | ||
# cat kyverno-pss.js-10vu-1000it-logs.txt | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters