Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run Playwright on self-hosted runners #2788

Merged
merged 4 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,31 @@ on:
required: false

jobs:
setup_playwright_runners:
uses: WalletConnect/gh-actions-runners/.github/workflows/setup-runners.yml@main
with:
cpu: 16384
memory: 65536
labels: playwright
count: 5
secrets:
GITHUB_PAT: ${{ secrets.RELEASE_TOKEN }}
TF_API_TOKEN: ${{ secrets.TFC_INFRA_TOKEN }}

ui_tests:
name: 'Playwright Tests'
runs-on:
group: ubuntu-runners
runs-on: [self-hosted, playwright]
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
shardTotal: [5]
timeout-minutes: 20
steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
# Possibly this helps with GitHub-hosted runner network issues, but it's not confirmed
# It's not supported in self-hosted runners, however, so commenting it out for now
# - name: Tune GitHub-hosted runner network
# uses: smorimoto/tune-github-hosted-runner-network@v1

- name: checkout
uses: actions/checkout@v4
Expand All @@ -75,17 +87,18 @@ jobs:
node-version: 18.x
cache: 'pnpm'

- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $GITHUB_ENV
# - name: Get installed Playwright version
# id: playwright-version
# run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $GITHUB_ENV

- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ hashFiles('apps/laboratory/tests/shared/constants/devices.ts') }}
# This cache causes weird errors on retry runs when using the self-hosted runners, disabling for now
# - name: Cache playwright binaries
# uses: actions/cache@v4
# id: playwright-cache
# with:
# path: |
# ~/.cache/ms-playwright
# key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ hashFiles('apps/laboratory/tests/shared/constants/devices.ts') }}

- name: Install dependencies
run: pnpm install
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/tests/shared/utils/email.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Mailsac } from '@mailsac/api'
const EMAIL_CHECK_INTERVAL = 2500
const MAX_EMAIL_CHECK = 48
const MAX_EMAIL_CHECK = 96
const EMAIL_APPROVE_BUTTON_TEXT = 'Approve this login'
const APPROVE_URL_REGEX = /https:\/\/register.*/u
const OTP_CODE_REGEX = /\d{3}\s?\d{3}/u
Expand Down
Loading