Increase coverage beyond 80% - #1
Conversation
|
Now the work is (nicely) done, specially the tables to test the corner cases 🚀 But this adds a new dependency the maintainer might not be willing to accept. I would check with them if they are willing to depend on it, as it seems they didn't use in the past. This is a new burden for them that they will need to maintain the package and the tests. For example currently the suggested package testthat is not used conditionally. If the package were missing or failed to install correctly the gofest package would fail tests (and yes, this happened on CRAN) |
averissimo
left a comment
There was a problem hiding this comment.
It's at 90.42% and the missing ones are probably unreachable as they are C functions not being used in R code.
I have some minor comments and mirroring @llrs-roche concern about testthat, the tests are possible without adding that dependency.
Can you adjust some of the value-based tests from SciPy?
| it("returns a valid qCvM quantile", { | ||
| q <- qCvM(0.9) | ||
| expect_true(is.numeric(q) && q > 0) | ||
| expect_equal(pCvM(q), 0.9, tolerance = 1e-3) | ||
| }) | ||
|
|
||
| it("returns matching qCvM quantiles for lower.tail inversion", { | ||
| expect_equal(qCvM(0.1, lower.tail = FALSE), qCvM(0.9)) | ||
| }) |
There was a problem hiding this comment.
This seem out of place of the describe block, maybe move out on itself
|
Consider adding CI actions for R CMD check with This might require some discussion with package owner, but it's such a small quality of life improvement, that it shouldn't be a problem. Or just add it here and we'll remove it on PR against upstream ps: going the extra mile with some concurrency protection. concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
|
Hi, thanks for the suggestion. |
averissimo
left a comment
There was a problem hiding this comment.
Looks good 🎩
I left some more tests (these were generated with AI converting the rest of SciPy tests)
I also noticed the CMD check (--as-cran) warns about versioning. It seems that the released version is superior to the git repo. However, the code (R and C) is identical, it only has some folders that don't seem necessary.
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
This PR adds unit tests for all the functions exported in the NAMESPACE.
The package does not have CI and is not using roxygen2 comments to manage documentation and function exports.
You have to run the tests locally and coverage as well:
This is my output:
The only tricky test was to find a table with the distribution of the Anderson-Darling statistic, but I finally used a reference mentioned in the paper that this package is based on.