r-lib / rprojroot

Finding files in project subdirectories
https://rprojroot.r-lib.org/
Other
149 stars 23 forks source link

Error: No root directory found in tests_i386/testthat and tests_x64/testthat #87

Closed llrs closed 8 months ago

llrs commented 2 years ago

Hi, I might be wrong but I'm using testthat to test a package and this issue has made me think the issue I'm facing might be due to rprojroot via testthat::test_check ->> rprojroot::is_testthat or something similar.

When I submit the package rtweet to devtools::checks_win_oldrelease(), it fails (temporary link) the checks because root directory is not found. This only happen with oldrelease in windows (with the current pre-release version) not on CRAN or other R versions of the presubmission checks:

Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # Use conditionally testthat
  > # if (requireNamespace("rtweet", quietly = TRUE)) {
  > library(testthat)
  > library(rtweet)
  > 
  > test_check("rtweet")
  Error: No root directory found in d:/RCompile/CRANguest/R-oldrelease/rtweet.Rcheck/tests_i386/testthat or its parent directories. Root criterion: contains a directory "tests"
  Execution halted
** running tests for arch 'x64' ... [2s] ERROR
  Running 'testthat.R' [1s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # Use conditionally testthat
  > # if (requireNamespace("rtweet", quietly = TRUE)) {
  > library(testthat)
  > library(rtweet)
  > 
  > test_check("rtweet")
  Error: No root directory found in d:/RCompile/CRANguest/R-oldrelease/rtweet.Rcheck/tests_x64/testthat or its parent directories. Root criterion: contains a directory "tests"
  Execution halted

I'm not sure why is this happening and why hasn't happened before (that I could find) or if it is worth fixing if R will soon(?) drop support for 32 bits systems. But I guess it was better to report it

krlmlr commented 2 years ago

Thanks. I don't have easy access to a Windows machine now, happy to review a PR.

krlmlr commented 8 months ago

i386 is not as relevant anymore.