-
Notifications
You must be signed in to change notification settings - Fork 61
103 lines (88 loc) · 3 KB
/
playwright-tests.yml
File metadata and controls
103 lines (88 loc) · 3 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
name: Playwright Tests
on:
push:
branches: [master, main, development]
pull_request:
branches: [master, main, development]
jobs:
test:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
auth_mode: [off, local]
services:
postgres:
image: postgis/postgis:13-3.1
env:
POSTGRES_DB: mmgis-test
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Setup Python for adjacent servers
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install adjacent server Python packages
run: pip install "titiler.application" "python-dotenv[cli]" uvicorn
- name: Setup test environment
run: |
cp sample.env .env || touch .env
echo "NODE_ENV=test" >> .env
echo "PORT=18888" >> .env
echo "AUTH=${{ matrix.auth_mode }}" >> .env
echo "DB_HOST=localhost" >> .env
echo "DB_PORT=5432" >> .env
echo "DB_NAME=mmgis-test" >> .env
echo "DB_USER=test_user" >> .env
echo "DB_PASS=test_password" >> .env
echo "DB_USER_TEST=test_user" >> .env
echo "DB_PASS_TEST=test_password" >> .env
echo "ENABLE_MMGIS_WEBSOCKETS=false" >> .env
echo "ENABLE_CONFIG_WEBSOCKETS=false" >> .env
echo "HIDE_CONFIG=false" >> .env
echo "SECRET=ci-test-session-secret-not-for-production" >> .env
# DB creation, Reference Mission setup, and server lifecycle are all
# handled by tests/global-setup.js (runs before any test suite).
# No manual init-db / server start / curl steps needed.
- name: Run Unit Tests
run: npx playwright test tests/unit --project=chromium
env:
AUTH: ${{ matrix.auth_mode }}
PLAYWRIGHT_TEST_UNIT_ONLY: "true"
- name: Run E2E API Tests
run: npx playwright test tests/e2e/api tests/e2e/security tests/e2e/startup --project=chromium
env:
AUTH: ${{ matrix.auth_mode }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.auth_mode }}
path: playwright-report/
retention-days: 30
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.auth_mode }}
path: test-results/
retention-days: 7