github-actions test-coverage fails on one package but passes on another?

I don't understand why in my Delaporte package the test-coverage action fails with an Error in file(con, "r") : cannot open the connection but in the revss package the test works. In both cases the R-Cmd-check yaml completes its workflow. Could it be the compiled code? The yamls are bit-identical. Thank you.

This problem has already been listed here without an answer:

In that repository the case when they received the error the package did not have any tests or R code,,

The issue with Delaporte seems to be that the package uses FORTRAN code, which requires gfortran, but the default C compiler on macOS is clang. The gcov formats between gcc and clang are different, so I think you would need to compile both the FORTRAN and C code with the same toolchain (and use the gcc gcov binary) to get the expected results. I can reproduce the same issue outside of GitHub Actions on macOS and see a more informative error with covr::package_coverage(quiet = FALSE).

Probably the easiest solution is for you to run the coverage action on a linux runner rather than a macOS one, which has gcc as the default toolchain. We default to using macOS because of CRAN supplied package binaries, but it is clearly causing friction in this case.

I opened a pull request with the necessary change at

1 Like

Thank you, Jim, that worked! I'll keep that in mind when I convert my fourth package to Github actions. It needs Rcpp, so if it fails on macOS I'll switch to ubuntu right away. Thank you again!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.