-
Notifications
You must be signed in to change notification settings - Fork 12
143 lines (120 loc) · 3.36 KB
/
Copy pathe2e-tests.yml
File metadata and controls
143 lines (120 loc) · 3.36 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: E2E Tests
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
workflow_dispatch:
jobs:
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.11'
- name: Set up uv
uses: astral-sh/setup-uv@v4.0.0
with:
version: "latest"
- name: Install dependencies
working-directory: apps/backend
run: uv sync --frozen --extra test
- name: Install Playwright browsers
working-directory: apps/backend
run: uv run playwright install --with-deps chromium
- name: Start backend server
working-directory: apps/backend
run: |
uv run uvicorn api.main:app --host 0.0.0.0 --port 8000 &
sleep 5
env:
APP_ENV: development
DATABASE_URL: sqlite:///./test.db
RATE_LIMIT_REQUESTS: "10000"
- name: Start frontend server
working-directory: apps/frontend
run: |
npm install
npm run build
npm run start &
sleep 10
env:
PORT: "1111"
NEXT_PUBLIC_API_URL: http://localhost:8000
- name: Run E2E tests
working-directory: apps/backend
run: |
uv run pytest tests/e2e/ -m e2e --tb=short -v
env:
E2E_BASE_URL: http://localhost:1111
E2E_API_URL: http://localhost:8000
E2E_HEADLESS: "true"
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4.4.0
with:
name: e2e-screenshots
path: apps/backend/tests/e2e/screenshots/
if-no-files-found: ignore
- name: Upload test videos
if: always()
uses: actions/upload-artifact@v4.4.0
with:
name: e2e-videos
path: apps/backend/tests/e2e/videos/
if-no-files-found: ignore
e2e-smoke-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.11'
- name: Set up uv
uses: astral-sh/setup-uv@v4.0.0
with:
version: "latest"
- name: Install dependencies
working-directory: apps/backend
run: uv sync --frozen --extra test
- name: Install Playwright browsers
working-directory: apps/backend
run: uv run playwright install --with-deps chromium
- name: Start backend server
working-directory: apps/backend
run: |
uv run uvicorn api.main:app --host 0.0.0.0 --port 8000 &
sleep 5
env:
APP_ENV: development
DATABASE_URL: sqlite:///./test.db
RATE_LIMIT_REQUESTS: "10000"
- name: Start frontend server
working-directory: apps/frontend
run: |
npm install
npm run build
npm run start &
sleep 10
env:
PORT: "1111"
NEXT_PUBLIC_API_URL: http://localhost:8000
- name: Run smoke tests
working-directory: apps/backend
run: |
uv run pytest tests/e2e/ -m "e2e and smoke" --tb=short -v
env:
E2E_BASE_URL: http://localhost:1111
E2E_API_URL: http://localhost:8000
E2E_HEADLESS: "true"