Files
pleno-vue/.github/workflows/tests.yml
T
Jeppe Bundgaard b5a8199472 Reduce default Vitest batch size to 5, enforce single-threaded execution, and refactor unit test wait conditions:
- Adjusted `run-vitest-unit-batches.mjs` to lower default batch size from 10 to 5 and enforce single-threaded execution for more predictable test behavior.
- Updated GitHub workflows to align with new batch size defaults.
- Introduced `waitForCondition` helper in unit tests to replace arbitrary delays with predicate-based waiting.
- Refactored `useEdgeGatewayTerminal` for improved session handling, including idle delay for shell polling and cleanup of request queuing logic.
2026-04-14 17:55:38 +02:00

131 lines
3.1 KiB
YAML

name: Automated Tests
on:
pull_request:
push:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
permissions:
contents: read
concurrency:
group: frontend-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Check frontend test formatting
run: npm run format:tests:check
build-and-unit:
needs: format-tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Build sanity check
run: npm run build
- name: Unit tests
run: npm run test:unit
env:
VITEST_BATCH_SIZE: 5
e2e-smoke:
if: github.event_name != 'schedule'
needs: build-and-unit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: [chromium-desktop, chromium-mobile]
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright smoke tests (${{ matrix.project }})
run: npx playwright test --grep @smoke --project="${{ matrix.project }}"
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-smoke-${{ matrix.project }}
path: |
output/playwright/report
output/playwright/test-results
if-no-files-found: ignore
retention-days: 7
e2e-full:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main'
needs: build-and-unit
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run full Playwright suite
run: npm run test:e2e:ci
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-full
path: |
output/playwright/report
output/playwright/test-results
if-no-files-found: ignore
retention-days: 14