Skip to content

Commit

Permalink
Pass ACT as env var
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcano committed Dec 15, 2023
1 parent b32b865 commit 071514a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/k6-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ jobs:
sudo apt-get install -y "/tmp/google-chrome-stable_current_amd64.deb" -f
- name: Run k6 foundations tests
run: ./run-tests.sh -t **/k6/foundations/*.js -u http://localhost:3333 -c ${{ env.ACT || 'false' }}
run: ./run-tests.sh -t **/k6/foundations/*.js -u http://localhost:3333
env:
ACT: ${{ env.ACT }}

- name: Run k6 browser tests
run: ./run-tests.sh -t **/k6/browser/*.js -u http://localhost:3333 -c ${{ env.ACT || 'false' }}
run: ./run-tests.sh -t **/k6/browser/*.js -u http://localhost:3333
env:
ACT: ${{ env.ACT }}
5 changes: 1 addition & 4 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/bin/bash
shopt -s globstar

while getopts "u:t:c:" flag; do
while getopts "u:t:" flag; do
case $flag in
u) BASE_URL="$OPTARG" ;;
t) TESTS="$OPTARG" ;;
c) ACT="$OPTARG" ;;
esac
done

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'
Expand Down

0 comments on commit 071514a

Please sign in to comment.