insightsengineering / teal.reporter

Create and preview reports with Shiny modules
https://insightsengineering.github.io/teal.reporter/
Other
8 stars 9 forks source link

[Bug]: CRAN issues #256

Closed gogonzo closed 6 months ago

gogonzo commented 7 months ago

What happened?

Message from CRAN:

Please see the problems shown on https://cran.r-project.org/web/checks/check_results_teal.reporter.html.

Please correct before 2024-03-20 to safely retain your package on CRAN.

There is a check service for M1mac issues: see https://www.stats.ox.ac.uk/pub/bdr/M1mac/README.txt . However, it is running a much older version of the OS and toolchain -- and the latter often matters.

m7pr commented 7 months ago

whoah, should we get M1mac locally so we can troubleshoot :D how do we make tests before we reupload?

gogonzo commented 7 months ago

whoah, should we get M1mac locally so we can troubleshoot :D how do we make tests before we reupload?

I got M1 and no issues at all. I think rhub or rhub2 should be able to do this https://cloud.r-project.org/web/packages/rhub/vignettes/rhub.html There is macos-m1-bigsur-release

m7pr commented 7 months ago

coolio!

donyunardi commented 7 months ago

Adding this to the sprint as we need to solve this by 20 MAR.

donyunardi commented 6 months ago

I see the error message this time.

R check result ```r * using log directory ‘/Users/ripley/R/packages/tests-devel/teal.reporter.Rcheck’ * using R Under development (unstable) (2024-03-11 r86096) * using platform: aarch64-apple-darwin23.4.0 * R was compiled by Apple clang version 15.0.0 (clang-1500.3.9.4) GNU Fortran (GCC) 12.2.0 * running under: macOS Sonoma 14.4 * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘teal.reporter/DESCRIPTION’ ... OK * this is package ‘teal.reporter’ version ‘0.3.0’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘teal.reporter’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking whether startup messages can be suppressed ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > pkg_name <- "teal.reporter" > library(pkg_name, character.only = TRUE) > testthat::test_check(pkg_name) Attaching package: 'testthat' The following object is masked from 'package:teal.reporter': Reporter Error in (function (card) : ARTIFICIAL ERROR Error in (function (card, comment) : ARTIFICIAL ERROR Error in (function () : ARTIFICIAL ERROR [ FAIL 2 | WARN 0 | SKIP 0 | PASS 344 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Failure ('test-DownloadReportModule.R:130:3'): report_render_and_compress - render an html document ── any(grepl("[.]Rmd", files)) is not TRUE `actual`: FALSE `expected`: TRUE ── Failure ('test-DownloadReportModule.R:131:3'): report_render_and_compress - render an html document ── any(grepl("[.]html", files)) is not TRUE `actual`: FALSE `expected`: TRUE [ FAIL 2 | WARN 0 | SKIP 0 | PASS 344 ] Error: Test failures Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... OK * checking PDF version of manual ... OK * checking HTML version of manual ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR See ‘/Users/ripley/R/packages/tests-devel/teal.reporter.Rcheck/00check.log’ for details. 38.88 real 32.34 user 4.56 sys ```

I don't see macos platform when I run rhub::platforms()

r$> platforms()
debian-clang-devel:
  Debian Linux, R-devel, clang, ISO-8859-15 locale
debian-gcc-devel:
  Debian Linux, R-devel, GCC
debian-gcc-devel-nold:
  Debian Linux, R-devel, GCC, no long double
debian-gcc-patched:
  Debian Linux, R-patched, GCC
debian-gcc-release:
  Debian Linux, R-release, GCC
fedora-clang-devel:
  Fedora Linux, R-devel, clang, gfortran
fedora-gcc-devel:
  Fedora Linux, R-devel, GCC
linux-x86_64-rocker-gcc-san:
  Debian Linux, R-devel, GCC ASAN/UBSAN
ubuntu-gcc-devel:
  Ubuntu Linux 20.04.1 LTS, R-devel, GCC
ubuntu-gcc-release:
  Ubuntu Linux 20.04.1 LTS, R-release, GCC
ubuntu-rchk:
  Ubuntu Linux 20.04.1 LTS, R-devel with rchk
windows-x86_64-devel:
  Windows Server 2022, R-devel, 64 bit
windows-x86_64-oldrel:
  Windows Server 2022, R-oldrel, 32/64 bit
windows-x86_64-patched:
  Windows Server 2022, R-patched, 32/64 bit
windows-x86_64-release:
  Windows Server 2022, R-release, 32/64 bit

r$> check(platforms = "macos-m1-bigsur-release")
Error in match_platform(platforms) : 
  Unknown R-hub platform, see rhub::platforms() for a list
Polkas commented 6 months ago

We have a new error message. https://www.stats.ox.ac.uk/pub/bdr/M1mac/teal.reporter.out

* checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > pkg_name <- "teal.reporter"
  > library(pkg_name, character.only = TRUE)

  > testthat::test_check(pkg_name)

  Attaching package: 'testthat'

  The following object is masked from 'package:teal.reporter':

      Reporter

  Error in (function (card)  : ARTIFICIAL ERROR
  Error in (function (card, comment)  : ARTIFICIAL ERROR
  Error in (function ()  : ARTIFICIAL ERROR
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 344 ]

  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-DownloadReportModule.R:130:3'): report_render_and_compress - render an html document ──
  any(grepl("[.]Rmd", files)) is not TRUE

  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-DownloadReportModule.R:131:3'): report_render_and_compress - render an html document ──
  any(grepl("[.]html", files)) is not TRUE

  `actual`:   FALSE
  `expected`: TRUE 

  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 344 ]
  Error: Test failures
  Execution halted

Solutions are to remove this testthat test, or to add skip on CRAN (testthat::skip_on_cran()), or it will disappear itself shortly. For me looks like a random error as "download_report_button_srv - subset of rmd_yaml_args" test is passing so this one should too.

m7pr commented 6 months ago

Or we do

if (platform == 'M1mac') {
  skip_on_cran()
} else {
  run_test
}

so that we only skip this test on CRAN for this paltform.

Polkas commented 6 months ago

Or we do

if (platform == 'M1mac') {
  skip_on_cran()
} else {
  run_test
}

so that we only skip this test on CRAN for this paltform.

Please be careful with that. Please check out the check page and that mac-arm64 is there and we passing on it. Teal.reporter is not passing on additional mac-arm64. What if they will update the software and the condition will be too specific.

m7pr commented 6 months ago

Then we will get another e-mail from CRAN and will do a review ;)

averissimo commented 6 months ago

All the tests pass when testing using GitHub's M1 CI image (os: macos-14)

https://github.com/averissimo/teal.reporter/actions/runs/8235572786/job/22521696256

edit: note that one of the other runs fails, but that's due to R setup action for an intel arch

image

gogonzo commented 6 months ago

The same error occurs in checks of the v0.3.0 on insighsengineering image. Current main doesn't throw this error. I suggest we release current teal.reporter, this should fix the problem.

see failing release version https://github.com/insightsengineering/teal.reporter/pull/263

gogonzo commented 6 months ago

Released https://cran.r-project.org/web/packages/teal.reporter/index.html