-
Notifications
You must be signed in to change notification settings - Fork 63
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Documentation: Clean up unit testting suite for date/datetime stuff #2369
Comments
@bms63 @millerg23 @StefanThoma think I drew up what is appropriate to do unit-testing wise, any thoughts before I churn them into individual bite sized issues such that we can get definitions of done? What're peoples' thoughts on snapshot testing as well? |
I really like the idea of having the same data object that we use throughout the entire date/time testing suite!! Can we construct that first before we start updating any tests? |
Very happy for snapshot tests. |
Regarding snapshot testing, is this for ERROR checking? We are implementing snapshot testing in admiraldev for assertions, this is part of the updates to ERROR messaging. So only need to snapshot the unit test in admiraldev, we should just be able to test for class of ERROR in admiral, or test partial strings. |
@StefanThoma - From Zelos' proposal. I was thinking the data object would have all these and anything else needed for other date/time tests. Then this object is used throughout all the tests and if we update the object, for some new issue, it runs through every single test again.
|
Precisely, @millerg23 as for why snapshots, on top of the errors, I think it's also just easier to review once we have a known example that we use consistently, don't think we need to remove the |
@StefanThoma @millerg23 @zdz2101 I follow this guy on LinkedIn and he is a goldmine. The Unit Testing principles are for Java, but I thought it was still a cool read - https://docs.google.com/document/d/1_Z9CjOjynrmZiYIvGqrR5sZ2s7v1f-RePAjdFHy9XEk/mobilebasic |
@zdz2101 could we make this into a discussion? Does the click on issue creation happen when this is in a discussion? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Please select a category the issue is focused on?
Other
Let us know where something needs a refresh or put your idea here!
For each of the 3 test files:
test-derive_vars_dt_dtm_utils.R
,test-derive_vars_dt.R
, andtest_derive_vars_dtm.R
there may be missing tests or additional coverage like NULL, NA, edge cases that need to be flushed out to make development easier.Task will be broken into multiple parts (feel free to turn each bullet into an issue and work on it):
In
test-derive_vars_dt_dtm_utils.R
:dt_level()
#2377get_imputation_target_date()
#2378get_imputation_target_time()
#2409In
test-derive_vars_dt.R
:There is some merit to consistently keep using the same input dataset/thing to test, where we can do:
and apply to all the above^. For the most part I think we do an appropriate range of tests, but can certainly do a better job at the test description or adding code comments where it is appropriate to explain the use case.
Cleanup/make appropriate additions for:
derive_vars_dt()
#2400withr
to remove use of global variables in the unified examplecompute_dtf()
: closed per Clean up documentation on datetime/date flagging functions, e.g.compute_dtf()
/compute_tmf()
to make development/maintenance easier #2343restricted_imputed_dtc_dt()
#2495impute_dtc_dt()
: closed with Create united example for test suite ofderive_vars_dt()
#2400convert_dtc_to_dt()
as necessary and figure out removal of global environment as well #2424derive_vars_dt()
In
test-derive_vars_dtm.R
:same as above but add:
Cleanup/make appropriate additions for:
compute_tmf()
: closed per Clean up documentation on datetime/date flagging functions, e.g.compute_dtf()
/compute_tmf()
to make development/maintenance easier #2343restricted_imputed_dtc_dtm()
impute_dtc_dtm()
convert_dtc_to_dtm()
derive_vars_dtm()
Dreaming...
The text was updated successfully, but these errors were encountered: