Skip to content

Commit

Permalink
run GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcano committed Dec 15, 2023
1 parent bbf643b commit c4b0356
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

shopt -s globstar

while getopts "u:t:c:" flag; do
Expand All @@ -14,11 +13,19 @@ BASE_URL="${BASE_URL:=http://localhost:3333}"
TESTS="${TESTS:=**/k6/foundations/*.js}"
ACT="${ACT:=false}"


export K6_BROWSER_HEADLESS=true
export K6_BROWSER_ARGS='no-sandbox'
if [ "$ACT" = "true" ]; then
export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome
fi

for test in $TESTS; do
# Run without thresholds because some examples will fail
K6_BROWSER_HEADLESS=true K6_BROWSER_ARGS='no-sandbox' k6 run --no-thresholds -e BASE_URL=$BASE_URL "$test"
# Disable thresholds because some threshold examples fail
k6 run --no-thresholds -e BASE_URL=$BASE_URL "$test"

exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
done

0 comments on commit c4b0356

Please sign in to comment.