From a87a438a3bd5c0942923507a55cd8da95773620d Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Tue, 12 Dec 2023 11:42:32 +0100 Subject: [PATCH] test: fix dev traces --- .github/workflows/playwright.yml | 7 ++++++- playwright.config.ts | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 089cede9d9a..df1ebc74e52 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -59,6 +59,11 @@ jobs: - name: Build extension in test mode run: yarn build:test + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + # Playwright can only test extensions in headed mode, see # https://playwright.dev/docs/chrome-extensions. To run a browser in # headed mode, a display server is necessary. However, this job runs on @@ -72,7 +77,7 @@ jobs: - name: Run Playwright tests run: xvfb-run yarn playwright test tests/specs --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=1 env: - GITHUB_HEAD_REF: ${{ github.head_ref }} + BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }} TEST_ACCOUNT_SECRET_KEY: ${{ secrets.TEST_ACCOUNT_SECRET_KEY }} - name: Upload blob report to GitHub Actions Artifacts diff --git a/playwright.config.ts b/playwright.config.ts index dd15fadaec6..46fc1379792 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,6 +1,6 @@ import { defineConfig, devices } from '@playwright/test'; -console.log('Branch: ', process.env.GITHUB_HEAD_REF); +console.log('Branch: ', process.env.BRANCH_NAME); /** * See https://playwright.dev/docs/test-configuration @@ -21,7 +21,7 @@ export default defineConfig({ use: { // Traces are heavy so we want to use them sparingly, but having full trace // to reference of the latest dev build is useful to inspect. - trace: process.env.GITHUB_HEAD_REF === 'dev' ? 'on' : 'on-first-retry', + trace: process.env.BRANCH_NAME === 'dev' ? 'on' : 'on-first-retry', }, projects: [ {