-
-
Notifications
You must be signed in to change notification settings - Fork 216
139 lines (117 loc) · 4.66 KB
/
e2e.yml
File metadata and controls
139 lines (117 loc) · 4.66 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
name: E2E Tracing Tests
on:
push:
branches:
- master
- release/**
pull_request:
jobs:
tracing-e2e:
name: Tracing E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Setup Elixir and Erlang
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: "1.18"
otp-version: "27.2"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Cache Elixir dependencies
uses: actions/cache@v5
with:
path: |
deps
_build
test_integrations/phoenix_app/deps
test_integrations/phoenix_app/_build
key: ${{ runner.os }}-elixir-1.18-otp-27.2-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-elixir-1.18-otp-27.2-mix-
- name: Cache Node.js dependencies
uses: actions/cache@v5
with:
path: |
test_integrations/tracing/node_modules
test_integrations/tracing/svelte_mini/node_modules
key: ${{ runner.os }}-node-20-${{ hashFiles('test_integrations/tracing/package-lock.json', 'test_integrations/tracing/svelte_mini/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-20-
- name: Install main project dependencies
run: mix deps.get
- name: Install Phoenix app dependencies
working-directory: test_integrations/phoenix_app
run: mix deps.get
- name: Compile Phoenix app
working-directory: test_integrations/phoenix_app
run: mix compile
- name: Install tracing test npm dependencies
working-directory: test_integrations/tracing
run: npm install
- name: Install Svelte app dependencies
working-directory: test_integrations/tracing/svelte_mini
run: npm install
- name: Install Playwright browsers
working-directory: test_integrations/tracing
run: npx playwright install --with-deps --only-shell chromium
- name: Start Phoenix server
working-directory: test_integrations/phoenix_app
run: |
rm -f tmp/sentry_debug_events.log
SENTRY_E2E_TEST_MODE=true SENTRY_ORG_ID=123 mix phx.server &
echo $! > /tmp/phoenix.pid
echo "Phoenix server started with PID $(cat /tmp/phoenix.pid)"
- name: Start Svelte server
working-directory: test_integrations/tracing/svelte_mini
run: |
SENTRY_E2E_SVELTE_APP_PORT=4001 npm run dev &
echo $! > /tmp/svelte.pid
echo "Svelte server started with PID $(cat /tmp/svelte.pid)"
- name: Wait for Phoenix server
run: |
echo "Waiting for Phoenix server at http://localhost:4000/health..."
timeout 60 bash -c 'until curl -s http://localhost:4000/health > /dev/null 2>&1; do echo "Waiting..."; sleep 2; done'
echo "Phoenix server is ready!"
curl -s http://localhost:4000/health
- name: Wait for Svelte server
run: |
echo "Waiting for Svelte server at http://localhost:4001/health..."
timeout 60 bash -c 'until curl -s http://localhost:4001/health > /dev/null 2>&1; do echo "Waiting..."; sleep 2; done'
echo "Svelte server is ready!"
curl -s http://localhost:4001/health
- name: Run Playwright tests
working-directory: test_integrations/tracing
env:
SENTRY_E2E_PHOENIX_APP_URL: http://localhost:4000
SENTRY_E2E_SVELTE_APP_URL: http://localhost:4001
SENTRY_E2E_SERVERS_RUNNING: "true"
run: npx playwright test --reporter=list
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: test_integrations/tracing/playwright-report/
retention-days: 7
- name: Upload test screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-screenshots
path: test_integrations/tracing/test-results/
retention-days: 7
- name: Show Phoenix server logs
if: failure()
run: |
echo "=== Sentry debug events log ==="
cat test_integrations/phoenix_app/tmp/sentry_debug_events.log 2>/dev/null || echo "No events logged"
- name: Cleanup servers
if: always()
run: |
[ -f /tmp/phoenix.pid ] && kill $(cat /tmp/phoenix.pid) 2>/dev/null || true
[ -f /tmp/svelte.pid ] && kill $(cat /tmp/svelte.pid) 2>/dev/null || true