From 071514afdfdb8a8f9bcf81ab177ba49933ac4527 Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Fri, 15 Dec 2023 11:11:45 +0100 Subject: [PATCH] Pass ACT as env var --- .github/workflows/k6-tests.yaml | 8 ++++++-- run-tests.sh | 5 +---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/k6-tests.yaml b/.github/workflows/k6-tests.yaml index 1ce7ad1f..8c638602 100644 --- a/.github/workflows/k6-tests.yaml +++ b/.github/workflows/k6-tests.yaml @@ -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 }} diff --git a/run-tests.sh b/run-tests.sh index 6a2d8523..f3ab84da 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -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'