Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests fail #419

Open
nunotexbsd opened this issue Dec 6, 2024 · 11 comments
Open

tests fail #419

nunotexbsd opened this issue Dec 6, 2024 · 11 comments

Comments

@nunotexbsd
Copy link

nunotexbsd commented Dec 6, 2024

Trying to find if a missing dependency is causing testunit to fail.
Tested on 0.5.0 and 0.5.1.

Any clues?

Thanks

> sessionInfo()
R version 4.4.2 (2024-10-31)
Platform: amd64-portbld-freebsd15.0
Running under: FreeBSD 15amd64-main 15.0-CURRENT FreeBSD 15.0-CURRENT 1500028 amd64

Matrix products: default
LAPACK: /usr/local/lib/R/lib/libRlapack.so;  LAPACK version 3.12.0

locale:
[1] C.UTF-8/C.UTF-8/C.UTF-8/C/C.UTF-8/C.UTF-8

time zone: Europe/Lisbon
tzcode source: system (FreeBSD)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.4.2
<snip>
* checking examples ... OK
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ...
  'FAQ.Rmd' using 'UTF-8'... failed
  'converting.Rmd' using 'UTF-8'... OK
  'cpp11.Rmd' using 'UTF-8'... failed
  'internals.Rmd' using 'UTF-8'... OK
  'motivations.Rmd' using 'UTF-8'... failed
 ERROR
Errors in running code in vignettes:
when running code in 'FAQ.Rmd'
  ...

> add_some <- function(x, amount = 1) {
+     add_some_(x, amount)
+ }

> add_some(1)

  When sourcing 'FAQ.R':
Error: could not find function "add_some_"
Execution halted
when running code in 'cpp11.Rmd'
  ...
> 600/(0.005 - 0.002)
[1] 2e+05

> mod <- lm(mpg ~ wt, data = mtcars)

> mpe(mod)

  When sourcing 'cpp11.R':
Error: could not find function "mpe"
Execution halted
when running code in 'motivations.Rmd'
  ...
[1] 2 4 6

> x
[1] 1 2 3

> z <- times_two_rcpp(x)

  When sourcing 'motivations.R':
Error: could not find function "times_two_rcpp"
Execution halted

* checking re-building of vignette outputs ... SKIPPED
* DONE
Status: 1 ERROR, 1 NOTE
*** Error code 1

Full log:
00check.log

@pachadotdev
Copy link
Contributor

pachadotdev commented Dec 17, 2024

@nunotexbsd the full log says Rcpp is missing, and hence the times_two_rcpp cannot be compiled

you need to install these mentioned in the log

Packages suggested but not available for checking:
  'covr', 'ggplot2', 'lobstr', 'rmarkdown', 'scales', 'Rcpp'

@nunotexbsd
Copy link
Author

nunotexbsd commented Dec 17, 2024

@pachadotdev
Hello,

I think I have all dependencies covered in port.
Do you mind take a look?

Thanks!

TEST_DEPENDS=   R-cran-covr>0:devel/R-cran-covr \
                R-cran-decor>0:devel/R-cran-decor \
                R-cran-ggplot2>0:graphics/R-cran-ggplot2 \
                R-cran-knitr>0:print/R-cran-knitr \
                R-cran-mockery>0:devel/R-cran-mockery \
                R-cran-progress>0:devel/R-cran-progress \
                R-cran-Rcpp>0:devel/R-cran-Rcpp \
                R-cran-rmarkdown>0:textproc/R-cran-rmarkdown \
                R-cran-scales>0:graphics/R-cran-scales \
                R-cran-testthat>0:devel/R-cran-testthat
pre-test:
# R-cran-bench package does not exist yet
        @${LOCALBASE}/bin/Rscript -e 'install.packages("bench", \
                repos = "https://cloud.r-project.org")'
# R-cran-lobstr package does not exist yet
        @${LOCALBASE}/bin/Rscript -e 'install.packages("lobstr", \
                repos = "https://cloud.r-project.org")'

Short error log:

<snip>
* checking for unstated dependencies in 'tests' ... OK
* checking tests ... OK
  Running 'testthat.R'
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... ERROR
Errors in running code in vignettes:
when running code in 'FAQ.Rmd'
  ...

> add_some <- function(x, amount = 1) {
+     add_some_(x, amount)
+ }

> add_some(1)

  When sourcing 'FAQ.R':
Error: could not find function "add_some_"
Execution halted
when running code in 'cpp11.Rmd'
  ...
> 600/(0.005 - 0.002)
[1] 2e+05

> mod <- lm(mpg ~ wt, data = mtcars)

> mpe(mod)

  When sourcing 'cpp11.R':
Error: could not find function "mpe"
Execution halted
when running code in 'motivations.Rmd'
  ...
[1] 2 4 6

> x
[1] 1 2 3

> z <- times_two_rcpp(x)

  When sourcing 'motivations.R':
Error: could not find function "times_two_rcpp"
Execution halted

  'FAQ.Rmd' using 'UTF-8'... failed
  'converting.Rmd' using 'UTF-8'... OK
  'cpp11.Rmd' using 'UTF-8'... failed
  'internals.Rmd' using 'UTF-8'... OK
  'motivations.Rmd' using 'UTF-8'... failed
* checking re-building of vignette outputs ... SKIPPED
* DONE
Status: 1 ERROR

Full log:
00check.log

@pachadotdev
Copy link
Contributor

@nunotexbsd I was finally able to replicate the error you have!

I added that in an unrelated PR but now I will add that tiny change by separate https://github.com/r-lib/cpp11/pull/427/files#diff-a66dc48b52fad8fe92354878da72e04c4b0bfb9d4fea933afcfa3020ac61b0ebR15

@nunotexbsd
Copy link
Author

@pachadotdev That's good news!

Didn't found a way to apply the shorter patch:
https://github.com/r-lib/cpp11/pull/427/files#diff-a66dc48b52fad8fe92354878da72e04c4b0bfb9d4fea933afcfa3020ac61b0ebR15 on 0.5.1 tarball from R-cran.

But I will stay tuned and wait for merge so I can test it.

Thanks

@pachadotdev
Copy link
Contributor

@nunotexbsd as I commented in the PR, can you install the github version from main?

@nunotexbsd
Copy link
Author

In order to use FreeBSD ports framework cran helpers, I did download cpp11-main.zip, uncompress and apply 9ebcf41 to it, create a new tarball and use it in ports.

Build is ok, but when running test:

* using log directory '/wrkdirs/usr/ports/devel/R-cran-cpp11/work/cpp11.Rcheck'
* using R version 4.4.2 (2024-10-31)
* using platform: amd64-portbld-freebsd15.0
* R was compiled by
    FreeBSD clang version 19.1.5 (https://github.com/llvm/llvm-project.git llvmorg-19.1.5-0-gab4b5a2db582)
    GNU Fortran (FreeBSD Ports Collection) 13.3.0
* running under: FreeBSD 15amd64-main 15.0-CURRENT FreeBSD 15.0-CURRENT 1500029 amd64
* using session charset: ASCII
* using options '--no-manual --no-build-vignettes'
* checking for file 'cpp11/DESCRIPTION' ... ERROR
Required fields missing or empty:
  'Author' 'Maintainer'
* DONE
Status: 1 ERROR

Maybe I missed something here.

@pachadotdev
Copy link
Contributor

In order to use FreeBSD ports framework cran helpers, I did download cpp11-main.zip, uncompress and apply 9ebcf41 to it, create a new tarball and use it in ports.

Build is ok, but when running test:

* using log directory '/wrkdirs/usr/ports/devel/R-cran-cpp11/work/cpp11.Rcheck'
* using R version 4.4.2 (2024-10-31)
* using platform: amd64-portbld-freebsd15.0
* R was compiled by
    FreeBSD clang version 19.1.5 (https://github.com/llvm/llvm-project.git llvmorg-19.1.5-0-gab4b5a2db582)
    GNU Fortran (FreeBSD Ports Collection) 13.3.0
* running under: FreeBSD 15amd64-main 15.0-CURRENT FreeBSD 15.0-CURRENT 1500029 amd64
* using session charset: ASCII
* using options '--no-manual --no-build-vignettes'
* checking for file 'cpp11/DESCRIPTION' ... ERROR
Required fields missing or empty:
  'Author' 'Maintainer'
* DONE
Status: 1 ERROR

Maybe I missed something here.

how about

R
remotes::install_github("r-lib/cpp11")

or

git clone https://github.com/r-lib/cpp11.git
cd cpp11
R
devtools::install()

@nunotexbsd
Copy link
Author

nunotexbsd commented Jan 4, 2025

OK, I'm building required depends so I can do both methods outside poudriere.

git clone https://github.com/r-lib/cpp11.git
cd cpp11
R
devtools::install()

# R CMD check cpp11test

* using log directory/home/nunotex/Work/cpp11/cpp11test.Rcheck* using R version 4.4.2 (2024-10-31)
* using platform: amd64-portbld-freebsd15.0
* R was compiled by
    FreeBSD clang version 19.1.5 (https://github.com/llvm/llvm-project.git llvmorg-19.1.5-0-gab4b5a2db582)
    GNU Fortran (FreeBSD Ports Collection) 13.3.0
* running under: FreeBSD leg.home 15.0-CURRENT FreeBSD 15.0-CURRENT #21 main-n274426-98e34e8e2557: Mon Dec 23 23:52:26 WET 2024     [email protected]:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64
* using session charset: UTF-8
* checking for filecpp11test/DESCRIPTION... ERROR
Required fields missing or empty:Author’ ‘Maintainer* DONE

Status: 1 ERROR
See/home/nunotex/Work/cpp11/cpp11test.Rcheck/00check.logfor details.

@pachadotdev
Copy link
Contributor

@nunotexbsd sorry, for a github repo the command is devtools::check(), unless you 1st build the tar file and then check the tar

@nunotexbsd
Copy link
Author

@pachadotdev after installing missing deps with > install.packages("PkgName"):

> devtools::check()

<snip>checking Rd \usage sections ...checking Rd contents ...checking for unstated dependencies in examples ...checking line endings in C/C++/Fortran sources/headers ...checking pragmas in C/C++ headers and code ...
    WARNINGqpdfis needed for checks on size reduction of PDFschecking installed files frominst/doc...checking files invignettes...checking examples (2.1s)
✔  checking for unstated dependencies intests...checking tests ...
    [13s/13s] OKthat.R* checking for unstated dependencies in vignettes ... OK
   * checking package vignettes ... OK
   * checking re-building of vignette outputs ... [35s/35s] OK
   * checking for non-standard things in the check directory ... OK
   * checking for detritus in the temp directory ... OK
   * DONE

   Status: 1 WARNING
   See/tmp/RtmpU7vTmY/file1232845813d99/cpp11.Rcheck/00check.logfor details.

── R CMD check results ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── cpp11 0.5.1.9000 ────
Duration: 59.7schecking pragmas in C/C++ headers and code ... OK
   WARNINGqpdfis needed for checks on size reduction of PDFs

0 errors| 1 warning| 0 notes

@pachadotdev
Copy link
Contributor

@pachadotdev after installing missing deps with > install.packages("PkgName"):

> devtools::check()

<snip>checking Rd \usage sections ...checking Rd contents ...checking for unstated dependencies in examples ...checking line endings in C/C++/Fortran sources/headers ...checking pragmas in C/C++ headers and code ...
    WARNINGqpdfis needed for checks on size reduction of PDFschecking installed files frominst/doc...checking files invignettes...checking examples (2.1s)
✔  checking for unstated dependencies intests...checking tests ...
    [13s/13s] OKthat.R* checking for unstated dependencies in vignettes ... OK
   * checking package vignettes ... OK
   * checking re-building of vignette outputs ... [35s/35s] OK
   * checking for non-standard things in the check directory ... OK
   * checking for detritus in the temp directory ... OK
   * DONE

   Status: 1 WARNING
   See/tmp/RtmpU7vTmY/file1232845813d99/cpp11.Rcheck/00check.logfor details.

── R CMD check results ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── cpp11 0.5.1.9000 ────
Duration: 59.7schecking pragmas in C/C++ headers and code ... OK
   WARNINGqpdfis needed for checks on size reduction of PDFs

0 errors| 1 warning| 0 notes

@nunotexbsd you are all set! the warning is something about the manual, which you can fix with a command equivalent to apt install qpdf and it only reduces the size of the pdf documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants