feat(r): add test coverage hooks for R testthat convention#529
Conversation
Add test_coverage module that maps tests/testthat/test-*.R to R/*.R, recognizes expect_* assertion patterns, handles library()/require() imports in test files, and strips R comments while preserving strings.
|
Thanks for the PR. I accepted the R test coverage hook feature with two conditions around redundant assertion patterns and Decision: fixed in the current tree. The R test coverage hooks are already present via prior commits Validation run:
This PR was already closed, so I am leaving this note as the final decision record. |
|
Thanks for the contribution. This is included in v1.0: https://github.com/peteromallet/desloppify/releases/tag/v1.0 |
Record co-author trailers for PR authors included in the v1.0 release cycle so GitHub can associate release-cycle contribution credit with the tag. Refs: #189, #484, #485, #486, #489, #493, #495, #529, #539, #573, #580, #581, #584, #585, #589, #602, #603 Co-authored-by: R. Desmond <134018026+0-CYBERDYNE-SYSTEMS-0@users.noreply.github.com> Co-authored-by: AreboursTLS <77301936+AreboursTLS@users.noreply.github.com> Co-authored-by: AugusteBalas <128148269+AugusteBalas@users.noreply.github.com> Co-authored-by: Alex Price <2804025+awprice@users.noreply.github.com> Co-authored-by: Klaus Agnoletti <24544601+klausagnoletti@users.noreply.github.com> Co-authored-by: Koshi <18751916+koshimazaki@users.noreply.github.com> Co-authored-by: Pietro <6080662+pietrondo@users.noreply.github.com> Co-authored-by: raveinid <7130195+raveinid@users.noreply.github.com> Co-authored-by: Ryan Gerstenkorn <4079939+RyanJarv@users.noreply.github.com> Co-authored-by: ryexLLC <217349586+ryexLLC@users.noreply.github.com> Co-authored-by: Maximilian Scholz <6530123+sims1253@users.noreply.github.com> Co-authored-by: Tristan Manchester <108270628+tristanmanchester@users.noreply.github.com>
Summary
Adds test coverage detection support for R projects following the standard testthat convention.
What this does
tests/testthat/test-*.R→R/*.Rsource filesexpect_*assertion patterns from testthatlibrary()/require()imports in test files for dependency resolutionChanges
Testing
All 19 tests pass. The module follows the same structure as existing R plugins (test coverage modules for Python, JavaScript, etc.).
This is a focused, standalone addition that does not modify any existing behavior — it only adds the
test_coverage_modulehook to the R language plugin.