-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0063 Move examples for internal functions to unit tests #69
Conversation
@ramiromagno @edgar-manukyan May I request your review of this MR? Thanks in advance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @ShiyuC for massive cleanup and awesome test 👍 I left one question for your kind consideration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShiyuC: great job! Thank you so much.
I think the only remaining bit is really to fix the test failures from the testing of derive_blfl()
. But I am guessing Kamil or Ram are better equipped to give you feedback here as they worked on this function.
And also still on derive_blfl()
, I would convert expect_snapshot_error()
to expect_snapshot(..., error = TRUE)
as expect_snapshot_error()
is under "questioning" status (check its documentation).
Test failures related to derive_blfl()
==> Testing R file using 'testthat'
ℹ Loading sdtm.oak
[ FAIL 8 | WARN 0 | SKIP 0 | PASS 7 ]
── Failure (test-derive_blfl.R:47:3): derive_blfl sdmt_in validations work ─────
Snapshot of `derive_blfl(...)` has changed:
old vs new
- Required variable `DOMAIN` is missing
+ Required variable `DOMAIN` is missing in `sdtm_in`
* Run testthat::snapshot_accept('derive_blfl') to accept the change.
* Run testthat::snapshot_review('derive_blfl') to interactively review the change.
── Failure (test-derive_blfl.R:58:3): derive_blfl sdmt_in validations work ─────
Snapshot of `derive_blfl(...)` has changed:
old vs new
- Required variables `oak_id`, `raw_source` and `patient_number` are missing
+ Required variables `oak_id`, `raw_source`, and `patient_number` are missing in `sdtm_in`
* Run testthat::snapshot_accept('derive_blfl') to accept the change.
* Run testthat::snapshot_review('derive_blfl') to interactively review the change.
── Failure (test-derive_blfl.R:74:3): derive_blfl sdmt_in validations work ─────
Snapshot of `derive_blfl(...)` has changed:
old vs new
- Required variables `VSORRES`, `VSSTAT`, `VSTESTCD` and `VSDTC` are missing
+ Required variables `VSORRES`, `VSSTAT`, `VSTESTCD`, and `VSDTC` are missing in `sdtm_in`
* Run testthat::snapshot_accept('derive_blfl') to accept the change.
* Run testthat::snapshot_review('derive_blfl') to interactively review the change.
Confirmed that the failed test will be addressed in a separate PR. |
@rammprasad I'm still not authorized to merge this PR after all conversations and conflicts are resolved. |
@ShiyuC I will merge this PR, we can check in another one why. |
EDIT: nevermind, I see that @galachad fixed this in #73, thanks (and indeed it was caused by
Hi @ramiromagno, the changes in test behavior are not justified by any codebase changes in this PR. Perhaps admiraldev was updated on the machine where the tests were run, allowing it to identify the object where the problem is detected. Regardless, these are good changes and should be accepted using testthat::snapshot_accept('derive_blfl').
@ShiyuC which issue is that? |
This PR moves all the example sections for internal functions to unit tests.
Closes #63
Please check off each taskbox as an acknowledgment that you completed the task
or check off that it is not relevant to your Pull Request. This checklist is
part of the Github Action workflows and the Pull Request will not be merged into
the
devel
branch until you have checked off each task.Request Title (Use Edit button in top-right if you need to update)
tidyverse style guide. Run
styler::style_file()
to style R and Rmd filesconsider realistic data scenarios and edge cases, e.g. empty datasets, errors,
boundary cases etc. - See
Unit Test Guide
fully follow the
deprecation guidance?
and families. Refer to the
categorization of functions to tag appropriate keyword/family.
devtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelyNEWS.md
if the changes pertain to a user-facing function (i.e. ithas an
@export
tag) or documentation aimed at users (rather than developers)pkgdown::build_site()
and check that all affectedexamples are displayed correctly and that all new functions occur on the "Reference" page.
lintr::lint_package()
R CMD check
locally and address all errors and warnings -devtools::check()