Thanks to visit codestin.com
Credit goes to github.com

Skip to content

devtools::test() and R CMD check ok but covr throws error #420

@GeoBosh

Description

@GeoBosh

My package lagged' passes devtools::test(), R CMD check, and builds successfully on TravisCI. However for some reason Coveralls was not getting coverage updates from Travis. It turned out that it was the 'covr' run after the build that was failing in the following line at the end of my .travis.yml

after_success:
  - Rscript -e 'covr::coveralls()'

More specifically, running the coverage tests locally I got:

library("covr")
package_coverage()
## ── 1. Failure: slMatrix (@test-pc20slMatrix.r#64)  ──────────────
## `nSeasons(msl) <- 5` threw an error with unexpected message.
## Expected match: "unable to find an inherited method for function 'nSeasons<-'"
## Actual message: "unable to find an inherited method for function ‘nSeasons<-’ for signature 
## ‘\"slMatrix\"’"

It is the quotes that cause the problem, but surprisingly for me, changing the quotes to dots in the expected regex didn't work:

── 1. Failure: slMatrix (@test-pc20slMatrix.r#64)  ────────
`nSeasons(msl) <- 5` threw an error with unexpected message.
Expected match: "unable to find an inherited method for function .nSeasons<-."
Actual message: "unable to find an inherited method for function ‘nSeasons<-’ for signature ‘\"slMatrix\"’"

It looks like there is a discrepancy between 'covr' and devtools here. I know that the above is not a 'minimal' reprex but it seems to convey the issue. The offending line above, now commented out is at the end of the file (see GeoBosh/lagged).

I resolved the issue by cutting off the regex just before the first quote but the expectation becomes less expressive this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions