Skip to content

Commit

Permalink
test: fix dev traces
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Dec 12, 2023
1 parent 11b48fc commit a87a438
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: [
{
Expand Down

0 comments on commit a87a438

Please sign in to comment.