-
Notifications
You must be signed in to change notification settings - Fork 12
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
pilot unit test refactor for AE_Map_Raw + workflow template #337
Conversation
|
||
# 1. output created as expected ------------------------------------------- | ||
test_that("output created as expected", { | ||
|
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.
Seems like we could fill in defaults here, no?
inst/templates/testthat_map.R
Outdated
input2 <- "dfY here" | ||
|
||
expect_snapshot_error( | ||
X_Map_Raw( |
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.
I believe in PREP we did a something {assessment}_Map_Raw
and then did a find/replace via grep.
Maybe add an assesssment
parameter to use_gsm_test
and then automatically update.
inst/templates/testthat_map.R
Outdated
) | ||
) | ||
|
||
expect_snapshot_error( |
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.
Maybe you can demo this for me at some point. I'm on the fence about whether it's needed.
tests/testthat/test_AE_Map_Raw.R
Outdated
expect_error(AE_Map_Raw(list(), dfRDSL)%>%suppressMessages,"Errors found in dfAE.") | ||
expect_error(AE_Map_Raw("Hi", "Mom")%>%suppressMessages,"Errors found in dfAE.") | ||
expect_error(AE_Map_Raw(dfAE, dfRDSL, mapping = list())%>%suppressMessages,"Errors found in dfAE.") | ||
expect_snapshot_error( |
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.
Also interested in how this will work on Github Actions ...
One other thought is that I wonder if we should limit the unit tests to synthetic data (set up in tribbles) and then just have the QC tests use clindata. That would somewhat simplify our pipeline to open source and (I think) make the unit tests much more stable and maintainable. |
This still needs some work but the general idea should work by pulling this branch and running
|
@jwildfire I think this is in a good place for you to review again and make sure it's shaping up how you'd like. Definitely happy to do a quick demo after scrum or some other convenient time |
Overview
use_gsm_test()
, modeled after this{usethis}
exampleexpect_snapshot_error
which captures all warning messages in.md
files intests/testthat/_snaps
.Test Notes/Sample Code
Risk Assessment
Risk: Low
Mitigation Strategy: