Skip to content

Commit 4f34457

Browse files
committed
tests: promote w/ new channel field in notification payload
1 parent b92a2c3 commit 4f34457

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

test/secrets.json

+1-34
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
11
{
2-
"slack_hooks": [
3-
{
4-
"url": "https://slack_webhook_url",
5-
"channel": "default"
6-
},
7-
{
8-
"url": "https://slack_webhook_url",
9-
"channel": "aa"
10-
},
11-
{
12-
"url": "https://slack_webhook_url",
13-
"channel": "longest-aa"
14-
},
15-
{
16-
"url": "https://slack_webhook_url",
17-
"channel": "backend"
18-
},
19-
{
20-
"url": "https://slack_webhook_url",
21-
"channel": "all-push-events"
22-
},
23-
{
24-
"url": "https://slack_webhook_url",
25-
"channel": "frontend-bot"
26-
},
27-
{
28-
"url": "https://slack_webhook_url",
29-
"channel": "aa-git"
30-
},
31-
{
32-
"url": "https://slack_webhook_url",
33-
"channel": "siren"
34-
}
35-
]
2+
"slack_access_token": ""
363
}

test/slack_payloads.expected

+33
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
===== file ../mock_payloads/commit_comment.different_author.json =====
22
will notify #all-push-events
33
{
4+
"channel": "all-push-events",
45
"attachments": [
56
{
67
"fallback":
@@ -18,6 +19,7 @@ will notify #all-push-events
1819
===== file ../mock_payloads/commit_comment.general_comment.json =====
1920
will notify #all-push-events
2021
{
22+
"channel": "all-push-events",
2123
"attachments": [
2224
{
2325
"fallback":
@@ -33,6 +35,7 @@ will notify #all-push-events
3335
===== file ../mock_payloads/commit_comment.general_comment_multiple_path.json =====
3436
will notify #aa
3537
{
38+
"channel": "aa",
3639
"attachments": [
3740
{
3841
"fallback":
@@ -47,6 +50,7 @@ will notify #aa
4750
}
4851
will notify #all-push-events
4952
{
53+
"channel": "all-push-events",
5054
"attachments": [
5155
{
5256
"fallback":
@@ -62,6 +66,7 @@ will notify #all-push-events
6266
===== file ../mock_payloads/commit_comment.long_comment.json =====
6367
will notify #all-push-events
6468
{
69+
"channel": "all-push-events",
6570
"attachments": [
6671
{
6772
"fallback":
@@ -80,6 +85,7 @@ will notify #all-push-events
8085
===== file ../mock_payloads/commit_comment.mrkdwn_comment.json =====
8186
will notify #all-push-events
8287
{
88+
"channel": "all-push-events",
8389
"attachments": [
8490
{
8591
"fallback":
@@ -98,6 +104,7 @@ will notify #all-push-events
98104
===== file ../mock_payloads/commit_comment.multiple_paths.json =====
99105
will notify #all-push-events
100106
{
107+
"channel": "all-push-events",
101108
"attachments": [
102109
{
103110
"fallback":
@@ -113,6 +120,7 @@ will notify #all-push-events
113120
===== file ../mock_payloads/commit_comment.short_comment.json =====
114121
will notify #all-push-events
115122
{
123+
"channel": "all-push-events",
116124
"attachments": [
117125
{
118126
"fallback":
@@ -130,6 +138,7 @@ will notify #all-push-events
130138
===== file ../mock_payloads/issue_comment.created_in_issue.json =====
131139
will notify #default
132140
{
141+
"channel": "default",
133142
"attachments": [
134143
{
135144
"fallback":
@@ -145,6 +154,7 @@ will notify #default
145154
===== file ../mock_payloads/issue_comment.created_in_pr.json =====
146155
will notify #aa-git
147156
{
157+
"channel": "aa-git",
148158
"attachments": [
149159
{
150160
"fallback":
@@ -159,6 +169,7 @@ will notify #aa-git
159169
}
160170
will notify #backend
161171
{
172+
"channel": "backend",
162173
"attachments": [
163174
{
164175
"fallback":
@@ -175,6 +186,7 @@ will notify #backend
175186
===== file ../mock_payloads/issue_comment.draft_pr.json =====
176187
will notify #frontend-bot
177188
{
189+
"channel": "frontend-bot",
178190
"attachments": [
179191
{
180192
"fallback":
@@ -192,6 +204,7 @@ will notify #frontend-bot
192204
===== file ../mock_payloads/issues.closed.json =====
193205
will notify #backend
194206
{
207+
"channel": "backend",
195208
"attachments": [
196209
{
197210
"fallback":
@@ -206,6 +219,7 @@ will notify #backend
206219
===== file ../mock_payloads/issues.labeled.json =====
207220
will notify #backend
208221
{
222+
"channel": "backend",
209223
"attachments": [
210224
{
211225
"fallback":
@@ -221,6 +235,7 @@ will notify #backend
221235
===== file ../mock_payloads/issues.opened.json =====
222236
will notify #default
223237
{
238+
"channel": "default",
224239
"attachments": [
225240
{
226241
"fallback":
@@ -237,6 +252,7 @@ will notify #default
237252
===== file ../mock_payloads/issues.reopened.json =====
238253
will notify #backend
239254
{
255+
"channel": "backend",
240256
"attachments": [
241257
{
242258
"fallback":
@@ -251,6 +267,7 @@ will notify #backend
251267
===== file ../mock_payloads/pull_request.closed_capitalized.json =====
252268
will notify #aa-git
253269
{
270+
"channel": "aa-git",
254271
"attachments": [
255272
{
256273
"fallback":
@@ -265,6 +282,7 @@ will notify #aa-git
265282
===== file ../mock_payloads/pull_request.closed_no_labels.json =====
266283
will notify #default
267284
{
285+
"channel": "default",
268286
"attachments": [
269287
{
270288
"fallback":
@@ -279,6 +297,7 @@ will notify #default
279297
===== file ../mock_payloads/pull_request.labeled_two_labels.json =====
280298
will notify #aa-git
281299
{
300+
"channel": "aa-git",
282301
"attachments": [
283302
{
284303
"fallback":
@@ -293,6 +312,7 @@ will notify #aa-git
293312
}
294313
will notify #backend
295314
{
315+
"channel": "backend",
296316
"attachments": [
297317
{
298318
"fallback":
@@ -308,6 +328,7 @@ will notify #backend
308328
===== file ../mock_payloads/pull_request.opened_one_label.json =====
309329
will notify #frontend-bot
310330
{
331+
"channel": "frontend-bot",
311332
"attachments": [
312333
{
313334
"fallback":
@@ -324,6 +345,7 @@ will notify #frontend-bot
324345
===== file ../mock_payloads/pull_request_review.approved.json =====
325346
will notify #default
326347
{
348+
"channel": "default",
327349
"attachments": [
328350
{
329351
"fallback":
@@ -339,6 +361,7 @@ will notify #default
339361
===== file ../mock_payloads/pull_request_review.commented.json =====
340362
will notify #frontend-bot
341363
{
364+
"channel": "frontend-bot",
342365
"attachments": [
343366
{
344367
"fallback":
@@ -356,6 +379,7 @@ will notify #frontend-bot
356379
===== file ../mock_payloads/pull_request_review.request_changes.json =====
357380
will notify #default
358381
{
382+
"channel": "default",
359383
"attachments": [
360384
{
361385
"fallback":
@@ -373,6 +397,7 @@ will notify #default
373397
===== file ../mock_payloads/pull_request_review_comment.created.json =====
374398
will notify #aa-git
375399
{
400+
"channel": "aa-git",
376401
"attachments": [
377402
{
378403
"fallback":
@@ -389,6 +414,7 @@ will notify #aa-git
389414
}
390415
will notify #backend
391416
{
417+
"channel": "backend",
392418
"attachments": [
393419
{
394420
"fallback":
@@ -408,6 +434,7 @@ will notify #backend
408434
===== file ../mock_payloads/push.two_commits.json =====
409435
will notify #all-push-events
410436
{
437+
"channel": "all-push-events",
411438
"text":
412439
"<https://github.com/thatportugueseguy/webhooks-test/tree/master|[webhooks-test:master]> <https://github.com/thatportugueseguy/webhooks-test/compare/fb245e2a6d52...e2173f38ae43|2 commits> pushed by thatportugueseguy",
413440
"attachments": [
@@ -427,6 +454,7 @@ will notify #all-push-events
427454
===== file ../mock_payloads/push.two_commits_longest_match.json =====
428455
will notify #all-push-events
429456
{
457+
"channel": "all-push-events",
430458
"text":
431459
"<https://github.com/thatportugueseguy/webhooks-test/tree/master|[webhooks-test:master]> <https://github.com/thatportugueseguy/webhooks-test/compare/fb245e2a6d52...e2173f38ae43|2 commits> pushed by thatportugueseguy",
432460
"attachments": [
@@ -445,6 +473,7 @@ will notify #all-push-events
445473
}
446474
will notify #longest-aa
447475
{
476+
"channel": "longest-aa",
448477
"text":
449478
"<https://github.com/thatportugueseguy/webhooks-test/tree/master|[webhooks-test:master]> <https://github.com/thatportugueseguy/webhooks-test/compare/fb245e2a6d52...e2173f38ae43|1 commit> pushed by thatportugueseguy",
450479
"attachments": [
@@ -465,6 +494,7 @@ will notify #longest-aa
465494
===== file ../mock_payloads/status.failure_test.json =====
466495
will notify #default
467496
{
497+
"channel": "default",
468498
"attachments": [
469499
{
470500
"fallback":
@@ -490,6 +520,7 @@ will notify #default
490520
===== file ../mock_payloads/status.success_public_repo_no_buildkite.json =====
491521
will notify #default
492522
{
523+
"channel": "default",
493524
"attachments": [
494525
{
495526
"fallback":
@@ -510,6 +541,7 @@ will notify #default
510541
===== file ../mock_payloads/status.success_test_main_branch.json =====
511542
will notify #all-push-events
512543
{
544+
"channel": "all-push-events",
513545
"attachments": [
514546
{
515547
"fallback":
@@ -531,6 +563,7 @@ will notify #all-push-events
531563
===== file ../mock_payloads/status.success_test_non_main_branch.json =====
532564
will notify #default
533565
{
566+
"channel": "default",
534567
"attachments": [
535568
{
536569
"fallback":

0 commit comments

Comments
 (0)