Skip to content

Commit 8a27c9f

Browse files
committedNov 21, 2024·
test issue comments for #23
1 parent 4ac2ee4 commit 8a27c9f

File tree

4 files changed

+127
-2
lines changed

4 files changed

+127
-2
lines changed
 

‎DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: repometrics
22
Title: Metrics for Your Code Repository
3-
Version: 0.1.1.053
3+
Version: 0.1.1.054
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

‎codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/repometrics",
99
"issueTracker": "https://github.com/ropensci-review-tools/repometrics/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.1.053",
11+
"version": "0.1.1.054",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
[
2+
{
3+
"url": "ghrepos/repo//issues/comments/190879177",
4+
"html_url": "https://github.com/repo//issues/7#issuecomment-190879177",
5+
"issue_url": "ghrepos/repo//issues/7",
6+
"id": 190879177,
7+
"node_id": "MDEyOklzc3VlQ29tbWVudDE5MDg3OTE3Nw==",
8+
"user": {
9+
"login": "gaborcsardi",
10+
"id": 660288,
11+
"node_id": "MDQ6VXNlcjY2MDI4OA==",
12+
"avatar_url": "https://avatars.githubusercontent.com/u/660288?v=4",
13+
"gravatar_id": "",
14+
"url": "ghusers/gaborcsardi",
15+
"html_url": "https://github.com/gaborcsardi",
16+
"followers_url": "ghusers/gaborcsardi/followers",
17+
"following_url": "ghusers/gaborcsardi/following{/other_user}",
18+
"gists_url": "ghusers/gaborcsardi/gists{/gist_id}",
19+
"starred_url": "ghusers/gaborcsardi/starred{/owner}{/repo}",
20+
"subscriptions_url": "ghusers/gaborcsardi/subscriptions",
21+
"organizations_url": "ghusers/gaborcsardi/orgs",
22+
"repos_url": "ghusers/gaborcsardi/repos",
23+
"events_url": "ghusers/gaborcsardi/events{/privacy}",
24+
"received_events_url": "ghusers/gaborcsardi/received_events",
25+
"type": "User",
26+
"user_view_type": "public",
27+
"site_admin": false
28+
},
29+
"created_at": "2016-03-01T20:00:57Z",
30+
"updated_at": "2016-03-01T20:00:57Z",
31+
"author_association": "COLLABORATOR",
32+
"body": "Hi! This is very much work in progress. `gp()` will be eventually exported. I do the development in `devtools`, and then it does not matter if it is not exported.\n\nI'll export it in a sec, but again, this package is not very useful currently, and most things, including `gp()` will change.\n",
33+
"reactions": {
34+
"url": "ghrepos/repo//issues/comments/190879177/reactions",
35+
"total_count": 0,
36+
"+1": 0,
37+
"-1": 0,
38+
"laugh": 0,
39+
"hooray": 0,
40+
"confused": 0,
41+
"heart": 0,
42+
"rocket": 0,
43+
"eyes": 0
44+
},
45+
"performed_via_github_app": null
46+
},
47+
{
48+
"url": "ghrepos/repo//issues/comments/190879265",
49+
"html_url": "https://github.com/repo//issues/7#issuecomment-190879265",
50+
"issue_url": "ghrepos/repo//issues/7",
51+
"id": 190879265,
52+
"node_id": "MDEyOklzc3VlQ29tbWVudDE5MDg3OTI2NQ==",
53+
"user": {
54+
"login": "gaborcsardi",
55+
"id": 660288,
56+
"node_id": "MDQ6VXNlcjY2MDI4OA==",
57+
"avatar_url": "https://avatars.githubusercontent.com/u/660288?v=4",
58+
"gravatar_id": "",
59+
"url": "ghusers/gaborcsardi",
60+
"html_url": "https://github.com/gaborcsardi",
61+
"followers_url": "ghusers/gaborcsardi/followers",
62+
"following_url": "ghusers/gaborcsardi/following{/other_user}",
63+
"gists_url": "ghusers/gaborcsardi/gists{/gist_id}",
64+
"starred_url": "ghusers/gaborcsardi/starred{/owner}{/repo}",
65+
"subscriptions_url": "ghusers/gaborcsardi/subscriptions",
66+
"organizations_url": "ghusers/gaborcsardi/orgs",
67+
"repos_url": "ghusers/gaborcsardi/repos",
68+
"events_url": "ghusers/gaborcsardi/events{/privacy}",
69+
"received_events_url": "ghusers/gaborcsardi/received_events",
70+
"type": "User",
71+
"user_view_type": "public",
72+
"site_admin": false
73+
},
74+
"created_at": "2016-03-01T20:01:18Z",
75+
"updated_at": "2016-03-01T20:01:18Z",
76+
"author_association": "COLLABORATOR",
77+
"body": "Exported `gp` in 5d377d299ead9adda9aa84541828f87dc97b1e00\n",
78+
"reactions": {
79+
"url": "ghrepos/repo//issues/comments/190879265/reactions",
80+
"total_count": 0,
81+
"+1": 0,
82+
"-1": 0,
83+
"laugh": 0,
84+
"hooray": 0,
85+
"confused": 0,
86+
"heart": 0,
87+
"rocket": 0,
88+
"eyes": 0
89+
},
90+
"performed_via_github_app": null
91+
}
92+
]

‎tests/testthat/test-cm-data-github.R

+33
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,36 @@ test_that ("cm data gh issues", {
9898
expect_type (issues [[n]], type)
9999
}
100100
})
101+
102+
test_that ("cm data gh issue commentss", {
103+
104+
Sys.setenv ("REPOMETRICS_TESTS" = "true")
105+
106+
path <- generate_test_pkg ()
107+
cmts <- with_mock_dir ("gh_api_issue_cmts", {
108+
issue_comments_from_gh_api (path, n_per_page = 2L)
109+
})
110+
111+
fs::dir_delete (path)
112+
113+
expect_s3_class (cmts, "data.frame")
114+
expect_equal (nrow (cmts), 2L)
115+
expect_equal (ncol (cmts), 9L)
116+
nms <- c (
117+
"issue_url", "issue_number", "comment_url", "comment_id", "user_login",
118+
"user_id", "created_at", "updated_a", "issue_body"
119+
)
120+
expect_equal (names (cmts), nms)
121+
122+
int_index <- c (2, 6)
123+
char_index <- seq_along (nms) [-int_index]
124+
int_nms <- nms [int_index]
125+
char_nms <- nms [char_index]
126+
for (n in names (cmts)) {
127+
type <- ifelse (n %in% char_nms, "character", "integer")
128+
if (n == "comment_id") {
129+
type <- "double"
130+
}
131+
expect_type (cmts [[n]], type)
132+
}
133+
})

0 commit comments

Comments
 (0)
Please sign in to comment.