Skip to content

Commit 8486582

Browse files
authored
chore: notify slack of e2e failures (#370)
* chore: notify slack of e2e failures * chore: fix config * chore: fix results url * chore: re-enable more tests * chore: reenable more * chore: don't notify Slack on PRs * chore: fix workflow logic
1 parent 042e4da commit 8486582

File tree

5 files changed

+31
-21
lines changed

5 files changed

+31
-21
lines changed

.github/workflows/run-tests.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,18 @@ jobs:
203203
pattern: blob-report-${{ matrix.version }}-*
204204
merge-multiple: true
205205

206-
- name: Merge into HTML Report
207-
run: npx playwright merge-reports --reporter html ./all-blob-reports
206+
- name: Merge reports
207+
run: |
208+
npx playwright merge-reports --reporter html ./all-blob-reports
209+
npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json
210+
211+
- name: Notify Slack
212+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.head_ref == 'main'
213+
run: npx playwright-slack-report -j merged_reports.json -c tests/playwright-slack-conf.json
214+
env:
215+
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_TOKEN }}
216+
RESULTS_VERSION: ${{ matrix.version }}
217+
RESULTS_URL: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}
208218

209219
- name: Upload HTML report
210220
uses: actions/upload-artifact@v4

.github/workflows/test-e2e.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
payload: ${{ steps.publish-test-results.outputs.slackEvent }}
253253

254254
- name: Publish test site
255-
if: (success() || failure()) && matrix.version == 'latest' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.head_ref == 'main'
255+
if: (success() || failure()) && matrix.version == 'latest' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
256256
run: |
257257
deno run -A tools/deno/junit2html.ts artifacts ${{needs.e2e.outputs.tag}} > report/index.html
258258
npx --yes netlify-cli@latest deploy --prod --cwd report

tests/netlify-deploy.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ export class NextDeployInstance extends NextInstance {
119119
this._url = data.deploy_url
120120
this._parsedUrl = new URL(this._url)
121121
this._deployId = data.deploy_id
122-
require('console').log(`Deployment URL: ${this._url}`)
122+
require('console').log(`Deployment URL: ${data.deploy_url}`)
123+
require('console').log(`Logs: ${data.logs}`)
123124
} catch (err) {
124125
console.error(err)
125126
throw new Error(`Failed to parse deploy output: ${deployRes.stdout}`)

tests/netlify-e2e.cjs

+2-17
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,7 @@ module.exports = {
22
version: 2,
33
suites: {
44
'test/e2e/app-dir/app-static/app-static.test.ts': {
5-
failed: [
6-
'app-dir static/dynamic handling usePathname should have values from canonical url on rewrite',
7-
'app-dir static/dynamic handling should have correct prerender-manifest entries',
8-
'app-dir static/dynamic handling should output HTML/RSC files for static paths',
9-
'app-dir static/dynamic handling should output debug info for static bailouts',
10-
],
11-
},
12-
'test/e2e/app-dir/app-client-cache/client-cache.test.ts': {
13-
failed: [
14-
'app dir client cache semantics prefetch={undefined} - default should re-use the full cache for only 30 seconds',
15-
'app dir client cache semantics prefetch={undefined} - default should refetch below the fold after 30 seconds',
16-
],
5+
failed: ['app-dir static/dynamic handling should warn for too many cache tags'],
176
},
187
'test/e2e/app-dir/headers-static-bailout/headers-static-bailout.test.ts': {
198
failed: [
@@ -24,14 +13,10 @@ module.exports = {
2413
'test/e2e/app-dir/parallel-routes-and-interception/parallel-routes-and-interception.test.ts': {
2514
failed: [],
2615
flakey: [
16+
// Uses patch file
2717
'parallel-routes-and-interception parallel routes should gracefully handle when two page segments match the `children` parallel slot',
2818
],
2919
},
30-
'test/e2e/app-dir/error-boundary-navigation/override-node-env.test.ts': {
31-
failed: [
32-
'app dir - not found navigation - with overridden node env should be able to navigate to other page from root not-found page',
33-
],
34-
},
3520
'test/e2e/opentelemetry/opentelemetry.test.ts': {
3621
failed: [
3722
'opentelemetry root context app router should handle RSC with fetch',

tests/playwright-slack-conf.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"sendResults": "on-failure",
3+
"slackLogLevel": "debug",
4+
"sendUsingBot": {
5+
"channels": ["C020GQEKC13"]
6+
},
7+
"meta": [
8+
{ "key": "version", "value": "__ENV_RESULTS_VERSION" },
9+
{
10+
"key": "results",
11+
"value": "__ENV_RESULTS_URL"
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)