-
Notifications
You must be signed in to change notification settings - Fork 58
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
getDbCohortMethodData unit-tests #146
Conversation
…nd after = TRUE when disconnecting from db
Codecov Report
@@ Coverage Diff @@
## develop #146 +/- ##
===========================================
+ Coverage 88.10% 88.33% +0.22%
===========================================
Files 23 23
Lines 5340 5356 +16
===========================================
+ Hits 4705 4731 +26
+ Misses 635 625 -10
|
Thanks, this is excellent work! I'll do some more digging into the |
PS. I think we'll deprecate the |
I've added dedicated unit-tests for
getDbCohortMethodData()
. Each parameter ofgetDbCohortMethodDate()
has a dedicated set of tests.I've also made the following changes in the existing code:
a. Added a function
dateCheck()
to check if a date is valid to replace the regex approach. The old regex approach allowed for non-existing dates like"20231736"
(2023-17-36).b. Removed the
if (is.null())
checks, asstudyStartDate
andstudyEndDate
will never equalNULL
, because of the checkmate assertion.Updated the assertion on
cdmVersion
, the old check allowed for any character of any length.on.exit()
inuploadExportedResults()
Wrapped the
unlink()
anddisconnect()
calls inwithr::defer()
andtryCatch()
, as the following error kept showing up on Ubuntu when running R-CMD-Check in the actions, when runningtest-eunomia.R
:and
I suspect that both
connection
anddatabaseIdentifierFile
are already cleaned up beforeunlink(databaseIdentifierFile)
anddisconnect(connection)
get to actually run on Ubuntu. I've tried playing around withon.exit(add, after)
as well, but that didn't seem to be working either.