From 5b06a433ff859e184d0d8d6dd0bca73650940928 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 7 Jul 2023 15:55:43 +0100 Subject: [PATCH] Add K6_BROWSER_EXECUTABLE_PATH in ci The github runners have both chromium and google chrome installed. Google chrome is kept up to date whereas chromium isn't. We want to work with the latest version of google chrome (for now, in the future we may want to install the exact version we want to work with). We've had issues working with chromium in the runners where the application crashes on startup. --- .github/workflows/e2e.yml | 3 +++ .github/workflows/test.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 412f54878..e8066dc97 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -64,6 +64,9 @@ jobs: # chrome --version doesn't work on Windows :-/ # See https://bugs.chromium.org/p/chromium/issues/detail?id=158372 run: (get-command chrome.exe).Version + - name: Set chrome exec path + if: runner.os == 'Linux' + run: export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome - name: Run E2E tests run: | set -x diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01d91ce3c..aa69fdec6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,6 +46,7 @@ jobs: args[1]="1" export GOMAXPROCS=1 fi + export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome export K6_BROWSER_HEADLESS=true go test "${args[@]}" -timeout 5m ./... @@ -75,6 +76,7 @@ jobs: go version export GOMAXPROCS=2 args=("-p" "2" "-race") + export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome export K6_BROWSER_HEADLESS=true go test "${args[@]}" -timeout 5m ./... @@ -104,6 +106,7 @@ jobs: args[1]="1" export GOMAXPROCS=1 fi + export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome export K6_BROWSER_HEADLESS=true echo "mode: set" > coverage.txt for pkg in $(go list ./... | grep -v vendor); do @@ -156,5 +159,6 @@ jobs: go get go.k6.io/k6@master go mod tidy cat go.mod | grep go.k6.io/k6 + export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome export K6_BROWSER_HEADLESS=true go test "${args[@]}" -timeout 5m ./...