> devtools::test()
Loading pcai.api
Testing pcai.api
✔ | OK F W S | Context
✔ | 1 | test_model [0.4 s]
══ Results ═════════════════════════════════════════════════════════════════════════════════════
Duration: 0.4 s
OK: 1
Failed: 0
Warnings: 0
Skipped: 0
It succeeds, however when I run devtools::check():
── Test failures ───────────────────────────────────────────────────────────────── testthat ────
> Sys.setenv("R_TESTS" = "")
>
> library(testthat)
> library(pcai.api)
>
> test_check("pcai.api")
── 1. Error: Test if a model can be correctly loaded from AWS (@test_model.R#5) ───────────────
cannot open the connection
1: source("plumber.R") at testthat/test_model.R:5
2: file(filename, "r", encoding = encoding)
══ testthat results ═══════════════════════════════════════════════════════════════════════════
[ OK: 0 | SKIPPED: 0 | WARNINGS: 1 | FAILED: 1 ]
1. Error: Test if a model can be correctly loaded from AWS (@test_model.R#5)
Error: testthat unit tests failed
Execution halted
1 error ✖ | 1 warning ✖ | 4 notes ✖
It fails because it cannot find the plumber.R file. But how am I supposed to access the functions of that file if this doesn't work? I am not too familiar with the R working directory.