Skip to content

Commit 1950225

Browse files
moved test data from tmp
1 parent c79869b commit 1950225

File tree

86 files changed

+4927
-10593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+4927
-10593
lines changed

github/payload_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func TestPayloads(t *testing.T) {
219219
tc := tt
220220
t.Run(tt.name, func(t *testing.T) {
221221
t.Parallel()
222-
payload, err := ioutil.ReadFile(pth.Join("../tmp", tc.filename))
222+
payload, err := ioutil.ReadFile(pth.Join("../testdata/github", tc.filename))
223223
assert.NoError(err)
224224
parsedPayload, err := ParsePayload(string(payload), tc.typ)
225225
assert.NoError(err)

scrape/github.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Scrape the github webhook documentation for example payloads
2+
// The data might need some manual massaging because some example values
3+
// are set to null.
24
package main
35

46
import (

testdata/github/check-run.json

100644100755
Lines changed: 256 additions & 177 deletions
Large diffs are not rendered by default.

testdata/github/check-suite.json

100644100755
Lines changed: 176 additions & 143 deletions
Large diffs are not rendered by default.

testdata/github/commit-comment.json

100644100755
Lines changed: 113 additions & 98 deletions
Large diffs are not rendered by default.
File renamed without changes.

testdata/github/create.json

100644100755
Lines changed: 94 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,125 @@
11
{
2-
"ref": "0.0.1",
2+
"ref": "simple-tag",
33
"ref_type": "tag",
44
"master_branch": "master",
5-
"description": "",
5+
"description": null,
66
"pusher_type": "user",
77
"repository": {
8-
"id": 35129377,
9-
"name": "public-repo",
10-
"full_name": "baxterthehacker/public-repo",
8+
"id": 186853002,
9+
"node_id": "MDEwOlJlcG9zaXRvcnkxODY4NTMwMDI=",
10+
"name": "Hello-World",
11+
"full_name": "Codertocat/Hello-World",
12+
"private": false,
1113
"owner": {
12-
"login": "baxterthehacker",
13-
"id": 6752317,
14-
"avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3",
14+
"login": "Codertocat",
15+
"id": 21031067,
16+
"node_id": "MDQ6VXNlcjIxMDMxMDY3",
17+
"avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
1518
"gravatar_id": "",
16-
"url": "https://api.github.com/users/baxterthehacker",
17-
"html_url": "https://github.com/baxterthehacker",
18-
"followers_url": "https://api.github.com/users/baxterthehacker/followers",
19-
"following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
20-
"gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
21-
"starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
22-
"subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
23-
"organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
24-
"repos_url": "https://api.github.com/users/baxterthehacker/repos",
25-
"events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
26-
"received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
19+
"url": "https://api.github.com/users/Codertocat",
20+
"html_url": "https://github.com/Codertocat",
21+
"followers_url": "https://api.github.com/users/Codertocat/followers",
22+
"following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
23+
"gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
24+
"starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
25+
"subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
26+
"organizations_url": "https://api.github.com/users/Codertocat/orgs",
27+
"repos_url": "https://api.github.com/users/Codertocat/repos",
28+
"events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
29+
"received_events_url": "https://api.github.com/users/Codertocat/received_events",
2730
"type": "User",
2831
"site_admin": false
2932
},
30-
"private": false,
31-
"html_url": "https://github.com/baxterthehacker/public-repo",
32-
"description": "",
33+
"html_url": "https://github.com/Codertocat/Hello-World",
34+
"description": null,
3335
"fork": false,
34-
"url": "https://api.github.com/repos/baxterthehacker/public-repo",
35-
"forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks",
36-
"keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}",
37-
"collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}",
38-
"teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams",
39-
"hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks",
40-
"issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}",
41-
"events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events",
42-
"assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}",
43-
"branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}",
44-
"tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags",
45-
"blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}",
46-
"git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}",
47-
"git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}",
48-
"trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}",
49-
"statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}",
50-
"languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages",
51-
"stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers",
52-
"contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors",
53-
"subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers",
54-
"subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription",
55-
"commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}",
56-
"git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}",
57-
"comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}",
58-
"issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}",
59-
"contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}",
60-
"compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}",
61-
"merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges",
62-
"archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}",
63-
"downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads",
64-
"issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}",
65-
"pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}",
66-
"milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}",
67-
"notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}",
68-
"labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
69-
"releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
70-
"created_at": "2015-05-05T23:40:12Z",
71-
"updated_at": "2015-05-05T23:40:30Z",
72-
"pushed_at": "2015-05-05T23:40:38Z",
73-
"git_url": "git://github.com/baxterthehacker/public-repo.git",
74-
"ssh_url": "git@github.com:baxterthehacker/public-repo.git",
75-
"clone_url": "https://github.com/baxterthehacker/public-repo.git",
76-
"svn_url": "https://github.com/baxterthehacker/public-repo",
36+
"url": "https://api.github.com/repos/Codertocat/Hello-World",
37+
"forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks",
38+
"keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}",
39+
"collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}",
40+
"teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams",
41+
"hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks",
42+
"issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}",
43+
"events_url": "https://api.github.com/repos/Codertocat/Hello-World/events",
44+
"assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}",
45+
"branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}",
46+
"tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags",
47+
"blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}",
48+
"git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}",
49+
"git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}",
50+
"trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}",
51+
"statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}",
52+
"languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages",
53+
"stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers",
54+
"contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors",
55+
"subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers",
56+
"subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription",
57+
"commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}",
58+
"git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}",
59+
"comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}",
60+
"issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}",
61+
"contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}",
62+
"compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}",
63+
"merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges",
64+
"archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}",
65+
"downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads",
66+
"issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}",
67+
"pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}",
68+
"milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}",
69+
"notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}",
70+
"labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}",
71+
"releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}",
72+
"deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments",
73+
"created_at": "2019-05-15T15:19:25Z",
74+
"updated_at": "2019-05-15T15:20:41Z",
75+
"pushed_at": "2019-05-15T15:20:56Z",
76+
"git_url": "git://github.com/Codertocat/Hello-World.git",
77+
"ssh_url": "git@github.com:Codertocat/Hello-World.git",
78+
"clone_url": "https://github.com/Codertocat/Hello-World.git",
79+
"svn_url": "https://github.com/Codertocat/Hello-World",
7780
"homepage": null,
7881
"size": 0,
7982
"stargazers_count": 0,
8083
"watchers_count": 0,
81-
"language": null,
84+
"language": "Ruby",
8285
"has_issues": true,
86+
"has_projects": true,
8387
"has_downloads": true,
8488
"has_wiki": true,
8589
"has_pages": true,
86-
"forks_count": 0,
90+
"forks_count": 1,
8791
"mirror_url": null,
92+
"archived": false,
93+
"disabled": false,
8894
"open_issues_count": 2,
89-
"forks": 0,
95+
"license": null,
96+
"forks": 1,
9097
"open_issues": 2,
9198
"watchers": 0,
9299
"default_branch": "master"
93100
},
94101
"sender": {
95-
"login": "baxterthehacker",
96-
"id": 6752317,
97-
"avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3",
102+
"login": "Codertocat",
103+
"id": 21031067,
104+
"node_id": "MDQ6VXNlcjIxMDMxMDY3",
105+
"avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4",
98106
"gravatar_id": "",
99-
"url": "https://api.github.com/users/baxterthehacker",
100-
"html_url": "https://github.com/baxterthehacker",
101-
"followers_url": "https://api.github.com/users/baxterthehacker/followers",
102-
"following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
103-
"gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
104-
"starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
105-
"subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
106-
"organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
107-
"repos_url": "https://api.github.com/users/baxterthehacker/repos",
108-
"events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
109-
"received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
107+
"url": "https://api.github.com/users/Codertocat",
108+
"html_url": "https://github.com/Codertocat",
109+
"followers_url": "https://api.github.com/users/Codertocat/followers",
110+
"following_url": "https://api.github.com/users/Codertocat/following{/other_user}",
111+
"gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}",
112+
"starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}",
113+
"subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions",
114+
"organizations_url": "https://api.github.com/users/Codertocat/orgs",
115+
"repos_url": "https://api.github.com/users/Codertocat/repos",
116+
"events_url": "https://api.github.com/users/Codertocat/events{/privacy}",
117+
"received_events_url": "https://api.github.com/users/Codertocat/received_events",
110118
"type": "User",
111119
"site_admin": false
120+
},
121+
"installation": {
122+
"id": 2311213,
123+
"node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMjMxMTIxMw=="
112124
}
113125
}

0 commit comments

Comments
 (0)