Skip to content

Commit 34f4997

Browse files
committed
tests: add cases that check repo-specific behavior
`status.multi_repo_disallowed_repo` If `allowed_repositories` excludes the payload repo, it should be ignored even if payload would generate notification otherwise. `status.multi_repo_independent_status_state` The status rules should be evaluated for the correct repo. In this test case, it should correctly detect that `master`'s last build status was a failure for the given payload repo, and issue a success notification, despite the last build status success in a different repo.
1 parent ad12cd2 commit 34f4997

5 files changed

+490
-0
lines changed
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
{
2+
"id": 0,
3+
"sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478",
4+
"name": "ahrefs/monorobot_test",
5+
"target_url": "https://buildkite.com/org/pipeline2/builds/2",
6+
"avatar_url": "https://example.org/avatars/oa/0",
7+
"context": "buildkite/pipeline2",
8+
"description": "Build #2 passed (5 minutes, 19 seconds)",
9+
"state": "success",
10+
"commit": {
11+
"sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478",
12+
"node_id": "00000000000000000000",
13+
"commit": {
14+
"author": {
15+
"name": "Wile E. Coyote",
16+
"email": "[email protected]",
17+
"date": "2020-06-02T03:14:51Z"
18+
},
19+
"committer": {
20+
"name": "GitHub Enterprise",
21+
"email": "[email protected]",
22+
"date": "2020-06-02T03:14:51Z"
23+
},
24+
"message": "Update README.md",
25+
"tree": {
26+
"sha": "ee5c539cad37c77348ce7a55756acc542b41cfc7",
27+
"url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/git/trees/ee5c539cad37c77348ce7a55756acc542b41cfc7"
28+
},
29+
"url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/git/commits/0d95302addd66c1816bce1b1d495ed1c93ccd478",
30+
"comment_count": 0,
31+
"verification": {
32+
"verified": false,
33+
"reason": "unsigned",
34+
"signature": null,
35+
"payload": null
36+
}
37+
},
38+
"url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/commits/0d95302addd66c1816bce1b1d495ed1c93ccd478",
39+
"html_url": "https://example.org/ahrefs/monorobot_test/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478",
40+
"comments_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/commits/0d95302addd66c1816bce1b1d495ed1c93ccd478/comments",
41+
"author": {
42+
"login": "wileecoyote",
43+
"id": 0,
44+
"node_id": "00000000000000000000",
45+
"avatar_url": "https://example.org/avatars/u/0",
46+
"gravatar_id": "",
47+
"url": "https://example.org/api/v3/users/wileecoyote",
48+
"html_url": "https://example.org/wileecoyote",
49+
"followers_url": "https://example.org/api/v3/users/wileecoyote/followers",
50+
"following_url": "https://example.org/api/v3/users/wileecoyote/following{/other_user}",
51+
"gists_url": "https://example.org/api/v3/users/wileecoyote/gists{/gist_id}",
52+
"starred_url": "https://example.org/api/v3/users/wileecoyote/starred{/owner}{/repo}",
53+
"subscriptions_url": "https://example.org/api/v3/users/wileecoyote/subscriptions",
54+
"organizations_url": "https://example.org/api/v3/users/wileecoyote/orgs",
55+
"repos_url": "https://example.org/api/v3/users/wileecoyote/repos",
56+
"events_url": "https://example.org/api/v3/users/wileecoyote/events{/privacy}",
57+
"received_events_url": "https://example.org/api/v3/users/wileecoyote/received_events",
58+
"type": "User",
59+
"site_admin": false
60+
},
61+
"committer": null,
62+
"parents": [
63+
{
64+
"sha": "04cb72d6dc8d92131282a7eff57f6caf632f0a39",
65+
"url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/commits/04cb72d6dc8d92131282a7eff57f6caf632f0a39",
66+
"html_url": "https://example.org/ahrefs/monorobot_test/commit/04cb72d6dc8d92131282a7eff57f6caf632f0a39"
67+
}
68+
]
69+
},
70+
"branches": [
71+
{
72+
"name": "master",
73+
"commit": {
74+
"sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478",
75+
"url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/commits/0d95302addd66c1816bce1b1d495ed1c93ccd478"
76+
},
77+
"protected": false
78+
}
79+
],
80+
"created_at": "2020-06-02T03:21:39+00:00",
81+
"updated_at": "2020-06-02T03:21:39+00:00",
82+
"repository": {
83+
"id": 0,
84+
"node_id": "00000000000000000000",
85+
"name": "monorobot_test",
86+
"full_name": "ahrefs/monorobot_test",
87+
"private": true,
88+
"owner": {
89+
"login": "ahrefs",
90+
"id": 0,
91+
"node_id": "00000000000000000000",
92+
"avatar_url": "https://example.org/avatars/u/0",
93+
"gravatar_id": "",
94+
"url": "https://example.org/api/v3/users/ahrefs",
95+
"html_url": "https://example.org/ahrefs",
96+
"followers_url": "https://example.org/api/v3/users/ahrefs/followers",
97+
"following_url": "https://example.org/api/v3/users/ahrefs/following{/other_user}",
98+
"gists_url": "https://example.org/api/v3/users/ahrefs/gists{/gist_id}",
99+
"starred_url": "https://example.org/api/v3/users/ahrefs/starred{/owner}{/repo}",
100+
"subscriptions_url": "https://example.org/api/v3/users/ahrefs/subscriptions",
101+
"organizations_url": "https://example.org/api/v3/users/ahrefs/orgs",
102+
"repos_url": "https://example.org/api/v3/users/ahrefs/repos",
103+
"events_url": "https://example.org/api/v3/users/ahrefs/events{/privacy}",
104+
"received_events_url": "https://example.org/api/v3/users/ahrefs/received_events",
105+
"type": "Organization",
106+
"site_admin": false
107+
},
108+
"html_url": "https://example.org/ahrefs/monorobot_test",
109+
"description": null,
110+
"fork": false,
111+
"url": "https://example.org/api/v3/repos/ahrefs/monorobot_test",
112+
"forks_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/forks",
113+
"keys_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/keys{/key_id}",
114+
"collaborators_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/collaborators{/collaborator}",
115+
"teams_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/teams",
116+
"hooks_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/hooks",
117+
"issue_events_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/issues/events{/number}",
118+
"events_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/events",
119+
"assignees_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/assignees{/user}",
120+
"branches_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/branches{/branch}",
121+
"tags_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/tags",
122+
"blobs_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/git/blobs{/sha}",
123+
"git_tags_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/git/tags{/sha}",
124+
"git_refs_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/git/refs{/sha}",
125+
"trees_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/git/trees{/sha}",
126+
"statuses_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/statuses/{sha}",
127+
"languages_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/languages",
128+
"stargazers_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/stargazers",
129+
"contributors_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/contributors",
130+
"subscribers_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/subscribers",
131+
"subscription_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/subscription",
132+
"commits_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/commits{/sha}",
133+
"git_commits_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/git/commits{/sha}",
134+
"comments_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/comments{/number}",
135+
"issue_comment_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/issues/comments{/number}",
136+
"contents_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/contents/{+path}",
137+
"compare_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/compare/{base}...{head}",
138+
"merges_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/merges",
139+
"archive_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/{archive_format}{/ref}",
140+
"downloads_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/downloads",
141+
"issues_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/issues{/number}",
142+
"pulls_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/pulls{/number}",
143+
"milestones_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/milestones{/number}",
144+
"notifications_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/notifications{?since,all,participating}",
145+
"labels_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/labels{/name}",
146+
"releases_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/releases{/id}",
147+
"deployments_url": "https://example.org/api/v3/repos/ahrefs/monorobot_test/deployments",
148+
"created_at": "2020-06-01T18:44:17Z",
149+
"updated_at": "2020-06-02T03:14:53Z",
150+
"pushed_at": "2020-06-02T03:14:51Z",
151+
"git_url": "git://example.org/ahrefs/monorobot_test.git",
152+
"ssh_url": "[email protected]:ahrefs/monorobot_test.git",
153+
"clone_url": "https://example.org/ahrefs/monorobot_test.git",
154+
"svn_url": "https://example.org/ahrefs/monorobot_test",
155+
"homepage": null,
156+
"size": 0,
157+
"stargazers_count": 0,
158+
"watchers_count": 0,
159+
"language": "Shell",
160+
"has_issues": true,
161+
"has_projects": false,
162+
"has_downloads": true,
163+
"has_wiki": true,
164+
"has_pages": false,
165+
"forks_count": 0,
166+
"mirror_url": null,
167+
"archived": false,
168+
"disabled": false,
169+
"open_issues_count": 0,
170+
"license": null,
171+
"forks": 0,
172+
"open_issues": 0,
173+
"watchers": 0,
174+
"default_branch": "master"
175+
},
176+
"organization": {
177+
"login": "ahrefs",
178+
"id": 0,
179+
"node_id": "00000000000000000000",
180+
"url": "https://example.org/api/v3/orgs/ahrefs",
181+
"repos_url": "https://example.org/api/v3/orgs/ahrefs/repos",
182+
"events_url": "https://example.org/api/v3/orgs/ahrefs/events",
183+
"hooks_url": "https://example.org/api/v3/orgs/ahrefs/hooks",
184+
"issues_url": "https://example.org/api/v3/orgs/ahrefs/issues",
185+
"members_url": "https://example.org/api/v3/orgs/ahrefs/members{/member}",
186+
"public_members_url": "https://example.org/api/v3/orgs/ahrefs/public_members{/member}",
187+
"avatar_url": "https://example.org/avatars/u/0",
188+
"description": null
189+
},
190+
"enterprise": {
191+
"id": 0,
192+
"slug": "ahrefs-corp",
193+
"name": "Acme Corp",
194+
"node_id": "00000000000000000000",
195+
"avatar_url": "https://example.org/avatars/b/0",
196+
"description": null,
197+
"website_url": null,
198+
"html_url": "https://example.org/enterprises/ahrefs-corp",
199+
"created_at": "2019-01-09T18:50:55Z",
200+
"updated_at": "2019-03-01T16:07:28Z"
201+
},
202+
"sender": {
203+
"login": "ygrek",
204+
"id": 0,
205+
"node_id": "00000000000000000000",
206+
"avatar_url": "https://example.org/avatars/u/0",
207+
"gravatar_id": "",
208+
"url": "https://example.org/api/v3/users/ygrek",
209+
"html_url": "https://example.org/ip",
210+
"followers_url": "https://example.org/api/v3/users/ygrek/followers",
211+
"following_url": "https://example.org/api/v3/users/ygrek/following{/other_user}",
212+
"gists_url": "https://example.org/api/v3/users/ygrek/gists{/gist_id}",
213+
"starred_url": "https://example.org/api/v3/users/ygrek/starred{/owner}{/repo}",
214+
"subscriptions_url": "https://example.org/api/v3/users/ygrek/subscriptions",
215+
"organizations_url": "https://example.org/api/v3/users/ygrek/orgs",
216+
"repos_url": "https://example.org/api/v3/users/ygrek/repos",
217+
"events_url": "https://example.org/api/v3/users/ygrek/events{/privacy}",
218+
"received_events_url": "https://example.org/api/v3/users/ygrek/received_events",
219+
"type": "User",
220+
"site_admin": true
221+
}
222+
}

0 commit comments

Comments
 (0)