Skip to content

Commit aa9d014

Browse files
committed
test: use filter_main_branch in test config
1 parent cf43ba7 commit aa9d014

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

mock_payloads/push.branch_filter_default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ref": "refs/heads/master",
2+
"ref": "refs/heads/develop",
33
"before": "fb245e2a6d52d10025c8bd4f36f6e3134d85ae18",
44
"after": "e2173f38ae43865433a182c1fc1b5442d9763b54",
55
"created": false,

mock_payloads/push.branch_filter_local.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ref": "refs/heads/develop",
2+
"ref": "refs/heads/master",
33
"before": "fb245e2a6d52d10025c8bd4f36f6e3134d85ae18",
44
"after": "e2173f38ae43865433a182c1fc1b5442d9763b54",
55
"created": false,

mock_payloads/push.two_commits.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ref": "refs/heads/master",
2+
"ref": "refs/heads/develop",
33
"before": "fb245e2a6d52d10025c8bd4f36f6e3134d85ae18",
44
"after": "e2173f38ae43865433a182c1fc1b5442d9763b54",
55
"created": false,
@@ -27,7 +27,9 @@
2727
},
2828
"added": [],
2929
"removed": [],
30-
"modified": ["README.md"]
30+
"modified": [
31+
"README.md"
32+
]
3133
},
3234
{
3335
"id": "e2173f38ae43865433a182c1fc1b5442d9763b54",
@@ -46,7 +48,9 @@
4648
"email": "[email protected]",
4749
"username": "thatportugueseguy"
4850
},
49-
"added": ["TESTING.md"],
51+
"added": [
52+
"TESTING.md"
53+
],
5054
"removed": [],
5155
"modified": []
5256
}
@@ -68,7 +72,9 @@
6872
"email": "[email protected]",
6973
"username": "thatportugueseguy"
7074
},
71-
"added": ["TESTING.md"],
75+
"added": [
76+
"TESTING.md"
77+
],
7278
"removed": [],
7379
"modified": []
7480
},
@@ -194,4 +200,4 @@
194200
"type": "User",
195201
"site_admin": false
196202
}
197-
}
203+
}

mock_payloads/push.two_commits_longest_match.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ref": "refs/heads/master",
2+
"ref": "refs/heads/develop",
33
"before": "fb245e2a6d52d10025c8bd4f36f6e3134d85ae18",
44
"after": "e2173f38ae43865433a182c1fc1b5442d9763b54",
55
"created": false,

test/monorobot.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
},
2121
"prefix_rules": {
2222
"default_channel": "default",
23-
"default_branch_filters": [
24-
"master"
25-
],
23+
"filter_main_branch": true,
2624
"rules": [
2725
{
2826
"match": [
@@ -56,7 +54,7 @@
5654
],
5755
"channel": "backend2",
5856
"branch_filters": [
59-
"develop"
57+
"master"
6058
]
6159
},
6260
{

test/slack_payloads.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ will notify #all-push-events
436436
{
437437
"channel": "all-push-events",
438438
"text":
439-
"<https://github.com/octocat/test-repo/tree/master|[test-repo:master]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|3 commits> pushed by octocat",
439+
"<https://github.com/octocat/test-repo/tree/develop|[test-repo:develop]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|3 commits> pushed by octocat",
440440
"attachments": [
441441
{
442442
"fallback": "Commit pushed notification",
@@ -455,7 +455,7 @@ will notify #backend1
455455
{
456456
"channel": "backend1",
457457
"text":
458-
"<https://github.com/octocat/test-repo/tree/master|[test-repo:master]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|1 commit> pushed by octocat",
458+
"<https://github.com/octocat/test-repo/tree/develop|[test-repo:develop]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|1 commit> pushed by octocat",
459459
"attachments": [
460460
{
461461
"fallback": "Commit pushed notification",
@@ -475,7 +475,7 @@ will notify #backend1
475475
{
476476
"channel": "backend1",
477477
"text":
478-
"<https://github.com/octocat/test-repo/tree/develop|[test-repo:develop]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|1 commit> pushed by octocat",
478+
"<https://github.com/octocat/test-repo/tree/master|[test-repo:master]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|1 commit> pushed by octocat",
479479
"attachments": [
480480
{
481481
"fallback": "Commit pushed notification",
@@ -494,7 +494,7 @@ will notify #backend2
494494
{
495495
"channel": "backend2",
496496
"text":
497-
"<https://github.com/octocat/test-repo/tree/develop|[test-repo:develop]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|2 commits> pushed by octocat",
497+
"<https://github.com/octocat/test-repo/tree/master|[test-repo:master]> <https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43|2 commits> pushed by octocat",
498498
"attachments": [
499499
{
500500
"fallback": "Commit pushed notification",
@@ -534,7 +534,7 @@ will notify #all-push-events
534534
{
535535
"channel": "all-push-events",
536536
"text":
537-
"<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",
537+
"<https://github.com/thatportugueseguy/webhooks-test/tree/develop|[webhooks-test:develop]> <https://github.com/thatportugueseguy/webhooks-test/compare/fb245e2a6d52...e2173f38ae43|2 commits> pushed by thatportugueseguy",
538538
"attachments": [
539539
{
540540
"fallback": "Commit pushed notification",
@@ -554,7 +554,7 @@ will notify #all-push-events
554554
{
555555
"channel": "all-push-events",
556556
"text":
557-
"<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",
557+
"<https://github.com/thatportugueseguy/webhooks-test/tree/develop|[webhooks-test:develop]> <https://github.com/thatportugueseguy/webhooks-test/compare/fb245e2a6d52...e2173f38ae43|2 commits> pushed by thatportugueseguy",
558558
"attachments": [
559559
{
560560
"fallback": "Commit pushed notification",
@@ -573,7 +573,7 @@ will notify #longest-aa
573573
{
574574
"channel": "longest-aa",
575575
"text":
576-
"<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",
576+
"<https://github.com/thatportugueseguy/webhooks-test/tree/develop|[webhooks-test:develop]> <https://github.com/thatportugueseguy/webhooks-test/compare/fb245e2a6d52...e2173f38ae43|1 commit> pushed by thatportugueseguy",
577577
"attachments": [
578578
{
579579
"fallback": "Commit pushed notification",

0 commit comments

Comments
 (0)