@@ -98,33 +98,111 @@ jobs:
98
98
if : steps.changed-files.outputs.any_changed == 'true'
99
99
working-directory : ./smoke-tests/otel-collector
100
100
run : bats .
101
- app-smoke-test :
102
- name : HyperDX App Smoke Test
103
- runs-on : ubuntu-latest
101
+ e2e-tests :
102
+ name : End-to-End Tests
103
+ runs-on : ubuntu-24.04
104
+ timeout-minutes : 15
105
+ container :
106
+ image : mcr.microsoft.com/playwright:v1.55.0-jammy
104
107
permissions :
108
+ contents : read
105
109
pull-requests : write
106
- contents : write
110
+
107
111
steps :
108
112
- name : Checkout
109
- id : checkout
110
113
uses : actions/checkout@v4
111
- - name : Waiting for vercel preview to be ready
112
- uses :
patrickedqvist/[email protected]
113
- id : waitFor200
114
+
115
+ - name : Setup Node.js
116
+ uses : actions/setup-node@v4
117
+ with :
118
+ node-version-file : ' .nvmrc'
119
+ cache-dependency-path : ' yarn.lock'
120
+ cache : ' yarn'
121
+
122
+ - name : Install dependencies
123
+ run : yarn install
124
+
125
+ - name : Build dependencies
126
+ run : npx nx run-many -t ci:build
127
+
128
+ - name : Run Playwright tests
129
+ run : |
130
+ cd packages/app
131
+ yarn test:e2e
132
+
133
+ - name : Upload Playwright report
134
+ uses : actions/upload-artifact@v4
135
+ if : always()
114
136
with :
115
- token : ${{ secrets.GITHUB_TOKEN }}
116
- max_timeout : 1200
117
- check_interval : 10
118
- - run : echo ${{steps.waitFor200.outputs.url}}
137
+ name : playwright-report
138
+ path : packages/app/playwright-report/
139
+ retention-days : 30
119
140
120
- - name : Stably Runner Action
121
- uses : stablyhq/stably-runner-action@v3
141
+ - name : Upload test results
142
+ uses : actions/upload-artifact@v4
143
+ if : always()
122
144
with :
123
- test-suite-id : cmc548u5u0001la04q7y8ddj2
124
- github-token : ${{ secrets.GITHUB_TOKEN }}
125
- api-key : ${{ secrets.STABLY_API_KEY }}
126
- environment : PRODUCTION
127
- variable-overrides : |
128
- {
129
- "SITE_URL": "${{ steps.waitFor200.outputs.url }}"
145
+ name : test-results
146
+ path : packages/app/test-results/
147
+ retention-days : 30
148
+
149
+ - name : Generate test results message
150
+ id : test-results
151
+ if : always() && github.event_name == 'pull_request'
152
+ uses : actions/github-script@v7
153
+ with :
154
+ result-encoding : string
155
+ script : |
156
+ const fs = require('fs');
157
+ const path = require('path');
158
+
159
+ try {
160
+ const resultsPath = path.join('packages/app/test-results/results.json');
161
+ if (fs.existsSync(resultsPath)) {
162
+ const results = JSON.parse(fs.readFileSync(resultsPath, 'utf8'));
163
+ const { stats } = results;
164
+
165
+ const failed = stats.unexpected || 0;
166
+ const passed = stats.expected || 0;
167
+ const flaky = stats.flaky || 0;
168
+ const skipped = stats.skipped || 0;
169
+ const duration = Math.round((stats.duration || 0) / 1000);
170
+
171
+ const summary = failed > 0
172
+ ? `❌ **${failed} test${failed > 1 ? 's' : ''} failed**`
173
+ : `✅ **All tests passed**`;
174
+
175
+ return `## E2E Test Results
176
+
177
+ ${summary} • ${passed} passed • ${skipped} skipped • ${duration}s
178
+
179
+ | Status | Count |
180
+ |--------|-------|
181
+ | ✅ Passed | ${passed} |
182
+ | ❌ Failed | ${failed} |
183
+ | ⚠️ Flaky | ${flaky} |
184
+ | ⏭️ Skipped | ${skipped} |
185
+
186
+ [View full report →](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`;
187
+ } else {
188
+ return `## E2E Test Results
189
+
190
+ ❌ **Test results file not found**
191
+
192
+ [View full report →](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`;
193
+ }
194
+ } catch (error) {
195
+ console.log('Could not parse test results:', error.message);
196
+ return `## E2E Test Results
197
+
198
+ ❌ **Error reading test results**
199
+
200
+ [View full report →](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`;
130
201
}
202
+
203
+ - name : Comment PR with test results
204
+ uses : mshick/add-pr-comment@v2
205
+ if : always() && github.event_name == 'pull_request'
206
+ with :
207
+ message : ${{ steps.test-results.outputs.result }}
208
+ message-id : e2e-test-results
0 commit comments