Skip to content

Test coverage using covr#431

Open
radbasa wants to merge 24 commits into
mainfrom
feature/covr-support
Open

Test coverage using covr#431
radbasa wants to merge 24 commits into
mainfrom
feature/covr-support

Conversation

@radbasa
Copy link
Copy Markdown
Contributor

@radbasa radbasa commented Jan 25, 2023

Changes

Two functions.

  • covr_r()
  • covr_report()

Requires {covr} >= 3.6.5.

How to use

Inside a rhino app

  1. Install {covr} version >= 3.6.5.
  2. rhino::covr_r() to run a coverage test
  3. rhino::covr_report() to produce an HTML report

@radbasa radbasa added the type: feature Major new functionality label Jan 25, 2023
@radbasa radbasa requested a review from jakubnowicki January 25, 2023 06:11
@radbasa radbasa self-assigned this Jan 25, 2023
@radbasa radbasa changed the title covr support Test coverage using covr Jan 25, 2023
@radbasa radbasa requested a review from kamilzyla January 25, 2023 06:20
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 25, 2023

Codecov Report

Merging #431 (d2daa72) into main (6696e81) will decrease coverage by 0.69%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #431      +/-   ##
==========================================
- Coverage   11.90%   11.21%   -0.69%     
==========================================
  Files           8        8              
  Lines         294      312      +18     
==========================================
  Hits           35       35              
- Misses        259      277      +18     
Impacted Files Coverage Δ
R/tools.R 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jakubnowicki jakubnowicki marked this pull request as draft January 25, 2023 07:49
@jakubnowicki
Copy link
Copy Markdown
Member

Since this PR depends on the change done to covr, we need to wait for it to be accepted and included in CRAN release.

Comment thread DESCRIPTION Outdated
@radbasa
Copy link
Copy Markdown
Contributor Author

radbasa commented Jan 25, 2023

Added parameters to rhino::covr_r()

#' @param test_files Character vector of test files with code to test the functions. Defaults to
#'   all test files in `tests/testthat` with the `test-<name>.R` filename pattern.
#' @param line_exclusions passed to `covr::file_coverage`
#' @param function_exclusions passed to `covr::file_coverage`

@radbasa
Copy link
Copy Markdown
Contributor Author

radbasa commented Feb 8, 2024

@Johan-rosa Any comments on the covr-related functions? Message in private if necessary.

@Johan-rosa
Copy link
Copy Markdown

@Johan-rosa Any comments on the covr-related functions? Message in private if necessary.

We're using these changes and everything is working as expected. Great job!

@radbasa radbasa marked this pull request as ready for review May 11, 2026 10:01
@radbasa radbasa requested a review from jakubnowicki May 11, 2026 10:02
Copy link
Copy Markdown
Member

@jakubnowicki jakubnowicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works really well, we are almost there. Please check my comments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add missing line at the end.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to cover two additional cases:

  1. Function imported with module$function (so a more basic one).
  2. Private function (with the second pattern from box guide).
    I have run some manual tests, and it works, but it is important to have the test case to monitor it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Major new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants