Re: Looking for help on R-cran-testthat testunit

From: Nuno Teixeira <eduardo_at_freebsd.org>
Date: Tue, 26 Aug 2025 14:58:04 UTC
Hello Joseph!

I waiting on a newer version of testthat because upstream found out more
about errors and fixed some.

==> 3rd edition requirement error is an ports framework problem of some
kind say upstream.
I asked uzsolt@ for help and he said to me that some workaround on cran
tests are being used by
ftp/R-cran-curl or print/R-cran-knitr

Using a custom make test:
```
do-test:
        @${FIND} ${WRKSRC} \( -name '*.o' -o -name '*.so' \) -delete
        @cd ${WRKDIR} ; ${SETENVI} ${WRK_ENV} ${MAKE_ENV}
_R_CHECK_FORCE_SUGGESTS_=FALSE \
        ${R_COMMAND} ${R_PRECMD_CHECK_OPTIONS} CMD check \
        ${R_POSTCMD_CHECK_OPTIONS} ${PORTNAME}
```
it fixes the 3rd edition error and lead us to a new one that upstream
already merged a fix:
https://github.com/r-lib/testthat/issues/2214#issuecomment-3188669439
https://github.com/r-lib/testthat/issues/2214

Maybe I should update right away the test target on port now... not sure.

Cheers,

Joseph Mingrone <jrm@freebsd.org> escreveu (domingo, 24/08/2025 à(s) 19:13):

> On Thu, 2025-08-14 at 18:05, Nuno Teixeira <eduardo@freebsd.org> wrote:
>
> > Hello,
>
> > Looking for help on R-cran-testthat testunits.
> > Failure could be related to our ports framework and need more expertise
> > here.
>
> > All help is welcome,
> > Thanks!
>
> > https://github.com/r-lib/testthat/issues/2214#issuecomment-3188669439
> > https://github.com/r-lib/testthat/issues/2214
>
> Hello Nuno,
>
> When I ran `make test`, it reported errors about missing packages, so I
> locally added this to devel/R-cran-testthat/Makefile:
>
> TEST_DEPENDS=   R-cran-covr>0:devel/R-cran-covr \
>                 ftp/R-cran-curl>0:ftp/R-cran-curl \
>                 R-cran-rmarkdown>0:textproc/R-cran-rmarkdown \
>                 R-cran-rstudioapi>0:devel/R-cran-rstudioapi \
>                 R-cran-S7>0:devel/R-cran-S7 \
>                 R-cran-shiny>0:www/R-cran-shiny \
>                 R-cran-usethis>0:devel/R-cran-usethis \
>                 R-cran-vctrs>0:devel/R-cran-vctrs \
>                 R-cran-xml2>0:textproc/R-cran-xml2
>
> It still reported that utils, a built-in package, was missing.  After
> investigating, I discovered that the DESCRIPTION file for the utils
> package was not always installed.  That issue is now fixed as of
> a8e266393d86d5f40045c03ee1cda64f323ce6c1.
>
>
> Now `make test` says
> [ FAIL 1 | WARN 12 | SKIP 132 | PASS 943 ]
>
> That one error is related to the 3rd edition stuff that is mentioned in
> the devel/R-cran-testthat/Makefile and described at:
> https://testthat.r-lib.org/articles/third-edition.html.
>
> Joe
>


-- 
Nuno Teixeira
FreeBSD UNIX:  <eduardo@FreeBSD.org>   Web:  https://FreeBSD.org