Finalise how covtracer is represented in v1.0 of the gh-action
From issue #8
The covtracer output here is pretty generic. We can do some filtering if we want to present other information. By default, NAs are included for documented objects that are untested. As well, there may be situations where the test_name is unknown, but there is still testing code that prompts package execution (often this is test setup code, outside of any test_that() call).
In the covtracer README, I include these columns just to illustrate the missingness of code coverage. In a report, I would choose other, more meaningful columns - I would drop test_name and count, and instead filter out unexported documentation (filter(is_exported = TRUE)) to only show untested, exported functions as those are a better indicator of the user contract of a package. Just for the sake of clarity, it might be nice to have a clean "No untested behavior" if the resulting table has no records instead of just showing an empty table.
Originally posted by @dgkf-roche in https://github.com/insightsengineering/thevalidatoR/issues/8#issuecomment-945941598
Changes made to the template starting here: https://github.com/insightsengineering/thevalidatoR/blob/main/template.Rmd#L166
And a built example here: https://github.com/epijim/admiral/releases/tag/v0.3.0-example
@dgkf-roche next step (to knock out before week end) would be to confirm with you these three tables provide a sufficient summary of relevant information from covtracer (at which point I think we are good to move this into prod).
Some updates that I think would help to clean this up:
table 4
- [x] rename "test_name" to "Test Description"
- [x] rename "file" to "Documentation"
- [x] Having the documentation files given as "example.Rd" might be a bit unclear. Would it be better to add a prefix of
file.path(params$pkg_dir, "man", file)(such that the displayed path would be "man/example.Rd", which might be more clear to a reviewer).
table 5
- [x] rename "alias" to, for example "Exported Package Object"
- [x] rename "file" to "Documentation"
- [x] filter unique rows
table 6
- [x] rename "alias" to, for example "Exported Package Object"
- [x] rename "any_direct_test", to "Tested Directly"
- [x] include "is_exported" column
- [x] filter for only exported objects (up for debate - communicates a slightly different meaning)