Skip to content

Commit 027e2c0

Browse files
authored
Merge pull request #123 from ropensci-review-tools/rm-org
rm more org files & fns for #105
2 parents 20b9e22 + e68886b commit 027e2c0

File tree

4 files changed

+2
-120
lines changed

4 files changed

+2
-120
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.6.079
3+
Version: 0.1.6.082
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

R/cm-collate-orgs.R

-63
This file was deleted.

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.6.079",
11+
"version": "0.1.6.082",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

tests/testthat/test-cm-models.R

-55
Original file line numberDiff line numberDiff line change
@@ -127,58 +127,3 @@ test_that ("collate all models", {
127127
model_fns <- get_cm_fns ("model")
128128
expect_named (models_all, c ("date", gsub ("cm\\_model\\_", "", model_fns)))
129129
})
130-
131-
test_that ("collate across orgs", {
132-
133-
Sys.setenv ("REPOMETRICS_TESTS" = "true")
134-
dat <- mock_rm_data ()
135-
path <- generate_test_pkg ()
136-
137-
# Then mock one set of org data:
138-
metrics_all <- withr::with_options (
139-
list ("repometrics_period" = 365.25 / 2),
140-
metrics_over_end_dates (path, end_date = end_date, num_years = 1)
141-
)
142-
models_all <- withr::with_options (
143-
list ("repometrics_period" = 365.25 / 2),
144-
models_over_end_dates (path, end_date = end_date, num_years = 1)
145-
)
146-
dat <- list (
147-
repo = repometrics_data_repo (path, num_cores = 1L),
148-
metrics = metrics_all,
149-
models = models_all
150-
)
151-
152-
org_dir <- fs::path (fs::path_temp (), "org")
153-
if (!fs::dir_exists (org_dir)) {
154-
fs::dir_create (org_dir)
155-
}
156-
path1 <- fs::dir_copy (path, fs::path (org_dir, "testpkg1"))
157-
path2 <- fs::dir_copy (path, fs::path (org_dir, "testpkg2"))
158-
fs::dir_delete (path)
159-
160-
d1 <- desc::desc_set ("Package" = "testpkg1", file = path1)
161-
d2 <- desc::desc_set ("Package" = "testpkg2", file = path2)
162-
163-
saveRDS (dat, fs::path (fs::path_temp (), "testpkg1.Rds"))
164-
saveRDS (dat, fs::path (fs::path_temp (), "testpkg2.Rds"))
165-
166-
# Then the main call, which loads those pre-saved data rather than
167-
# re-generating:
168-
org_data <- repometrics_collate_org_data (
169-
org_dir,
170-
end_date = end_date,
171-
num_years = 1
172-
)
173-
174-
fs::dir_delete (c (path1, path2))
175-
176-
expect_type (org_data, "list")
177-
expect_named (org_data, c ("repos", "metrics", "models"))
178-
npkgs <- 2L
179-
expect_length (org_data$repos, npkgs)
180-
expect_length (org_data$metrics, npkgs)
181-
expect_s3_class (org_data$models, "data.frame")
182-
n_periods <- length (get_end_date_seq (end_date = end_date, num_years = 1))
183-
expect_equal (nrow (org_data$models), n_periods)
184-
})

0 commit comments

Comments
 (0)