perf: use ccache and parallel make, and skip already-built newer-R candidates in bulk (#240)
Some checks failed
ci/crow/cron/process-updates/2 Pipeline was successful
ci/crow/cron/process-updates/11 Pipeline was successful
ci/crow/cron/process-updates/9 Pipeline was successful
ci/crow/cron/process-updates/16 Pipeline was successful
ci/crow/cron/process-updates/8 Pipeline was successful
ci/crow/cron/process-updates/15 Pipeline was successful
ci/crow/cron/process-updates/13 Pipeline was successful
ci/crow/cron/process-updates/10 Pipeline was successful
ci/crow/cron/process-updates/12 Pipeline was successful
ci/crow/cron/process-updates/4 Pipeline was successful
ci/crow/cron/process-updates/14 Pipeline was successful
ci/crow/cron/process-updates/3 Pipeline was successful
ci/crow/cron/process-updates/6 Pipeline is running
ci/crow/cron/process-updates/5 Pipeline failed
ci/crow/cron/process-updates/7 Pipeline was successful
ci/crow/cron/process-updates/1 Pipeline was successful

This commit is contained in:
Patrick Schratz 2026-10-23 13:17:59 +00:00 • committed by Patrick Schratz
commit 773add042c

View file

@ -1,4 +1,5 @@
source(file.path("..", "newer-r-helpers.R"))
source(file.path("..", "rebuild-missing-helpers.R"))
test_that("R constraints respect patch versions, bounds, and missing fields", {
expect_true(r_requirement_satisfied(NA_character_, "4.4.3"))
@ -79,3 +80,70 @@ test_that("R-devel Recommended copies cannot block ordinary CRAN dependencies",
c("arules", "arulesSequences", "indirect")
)
})
candidates <- function() {
data.frame(
Package = c(
"flat_done",
"flat_todo",
"minor_done",
"minor_flat_only",
"unclassified",
"fallback"
),
Version = c("1.0", "1.0", "2.0", "2.0", "3.0", "4.0")
)
}
verdicts <- c(
flat_done_1.0 = FALSE,
flat_todo_1.0 = FALSE,
minor_done_2.0 = TRUE,
minor_flat_only_2.0 = TRUE,
fallback_4.0 = FALSE
)
flat <- c(
flat_done_1.0.tar.gz = "aaa",
minor_flat_only_2.0.tar.gz = "bbb",
unclassified_3.0.tar.gz = "ccc",
fallback_4.0.tar.gz = "c0ffee"
)
minor <- c(minor_done_2.0.tar.gz = "ddd")
md5 <- c(fallback_4.0 = "c0ffee")
test_that("newer_r_outstanding skips only binaries at the routed path", {
expect_identical(
newer_r_outstanding(candidates(), verdicts, flat, minor, md5)$Package,
# flat_todo: absent; minor_flat_only: sensitive, so a flat copy does not
# count; unclassified: no verdict, left to bincraft; fallback: CRAN source
c("flat_todo", "minor_flat_only", "unclassified", "fallback")
)
})
test_that("newer_r_outstanding keeps a route whose slot could not be listed", {
expect_identical(
newer_r_outstanding(candidates(), verdicts, NULL, minor, md5)$Package,
c("flat_done", "flat_todo", "minor_flat_only", "unclassified", "fallback")
)
expect_identical(
newer_r_outstanding(candidates(), verdicts, flat, NULL, md5)$Package,
c("flat_todo", "minor_done", "minor_flat_only", "unclassified", "fallback")
)
})
test_that("newer_r_outstanding without verdicts or listings changes nothing", {
expect_identical(
newer_r_outstanding(candidates(), logical(), flat, minor, md5),
candidates()
)
empty <- stats::setNames(character(), character())
expect_identical(
nrow(newer_r_outstanding(candidates(), verdicts, empty, empty, md5)),
nrow(candidates())
)
expect_identical(
nrow(newer_r_outstanding(candidates()[0L, ], verdicts, flat, minor, md5)),
0L
)
})