Repository navigation
90 lines (76 loc) · 2.92 KB
/
Copy pathe2e.yml
File metadata and controls
90 lines (76 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: E2E Tests
on:
push:
branches: [ main, dev ]
pull_request:
workflow_dispatch:
env:
NODE_VERSION: '22'
COMPOSE_PROJECT_NAME: vulnerabilityhub-e2e
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.playwright-browsers
E2E_FRONTEND_PORT: '4173'
E2E_BACKEND_PORT: '18000'
jobs:
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: pip
cache-dependency-path: |
src/backend/requirements.txt
src/database/requirements-migrations.txt
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: src/frontend/app/package-lock.json
- name: Install backend and frontend dependencies
run: |
python -m pip install -r src/backend/requirements.txt
python -m pip install -r src/database/requirements-migrations.txt
npm --prefix src/frontend/app ci
- name: Test the combined E2E runner
env:
E2E_TEST_DATABASE: '1'
run: python -m unittest discover -s scripts/e2e/tests -v
- name: Install Playwright browser
working-directory: ./src/frontend/app
run: npx playwright install --with-deps chromium
- name: Run all end-to-end tests
env:
E2E_SKIP_CLEANUP: '1'
E2E_FRONTEND_SERVER: preview
run: bash scripts/e2e/run-with-retry.sh
- name: Run production CSRF smoke tests
env:
E2E_SUITE: smoke
E2E_SKIP_CLEANUP: '1'
E2E_FRONTEND_SERVER: preview
E2E_ENV: production
PLAYWRIGHT_HTML_OUTPUT_DIR: playwright-report/production
run: bash scripts/e2e/run-with-retry.sh --grep 'bootstraps the initial admin account|authenticates, updates the profile, and rotates the password|recovers stale CSRF tokens|links and resolves a dispute after the CSRF cookie expires' --output=test-results/production --reporter=line
- name: Upload Playwright artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-artifacts
path: |
src/frontend/app/playwright-report
src/frontend/app/test-results
if-no-files-found: ignore
- name: Dump Docker Compose logs
if: failure()
run: |
docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile dev ps
docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile dev logs --tail=200 migrate backend ldap-worker db clamav mailhog
- name: Stop e2e stack
if: always()
run: docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile dev down -v --remove-orphans