It looks like devtools::test() is more rigorous on namespace and evaluation than how tests are ran under R CMD check:
── Failed tests ─────────────────────────────────
Error (test-independent-testing-meta_run.R:15:3): all analysis based on the analysis plan would be executed
Error in `ae_summary(meta = meta, population = "apat", observation = "wk12",
parameter = "any;rel;ser")`: could not find function "ae_summary"
Backtrace:
▆
1. ├─testthat::expect_equal(class(meta_run(meta)), "list") at test-independent-testing-meta_run.R:15:3
2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
4. └─metalite::meta_run(meta)
5. └─base::lapply(call, function(x) eval(parse(text = x))) at metalite/R/meta_run.R:45:3
6. └─metalite (local) FUN(X[[i]], ...)
Error (test-independent-testing-meta_run.R:19:3): only the first analysis based on the analysis plan would be executed
Error in `ae_summary(meta = meta, population = "apat", observation = "wk12",
parameter = "any;rel;ser")`: could not find function "ae_summary"
Backtrace:
▆
1. ├─testthat::expect_equal(class(meta_run(meta, i = 1)), "list") at test-independent-testing-meta_run.R:19:3
2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
4. └─metalite::meta_run(meta, i = 1)
5. └─base::lapply(call, function(x) eval(parse(text = x))) at metalite/R/meta_run.R:45:3
6. └─metalite (local) FUN(X[[i]], ...)
Error (test-independent-testing-meta_run.R:23:3): selected analysis based on the analysis plan would be executed
Error in `ae_summary(meta = meta, population = "apat", observation = "wk12",
parameter = "any;rel;ser")`: could not find function "ae_summary"
Backtrace:
▆
1. ├─testthat::expect_equal(...) at test-independent-testing-meta_run.R:23:3
2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
4. └─metalite::meta_run(meta, i = c(1, 3, 5))
5. └─base::lapply(call, function(x) eval(parse(text = x))) at metalite/R/meta_run.R:45:3
6. └─metalite (local) FUN(X[[i]], ...)
[ FAIL 3 | WARN 0 | SKIP 0 | PASS 257 ]
It looks like
devtools::test()
is more rigorous on namespace and evaluation than how tests are ran underR CMD check
: