Adding Unit Tests
Closed this issue · 3 comments
Actions:
- Create an estimation study specification .json for use with Enuomia (celecoxib vs. diclofenac for GI Bleed)
- Add unit test to the Hydra Java project for testing the hydrate functionality
- Add unit tests in Hydra R for hydrating package off of .json spec mentioned above
- Add unit tests in Hydra R for building the resulting package
- Add unit tests in Hydra R for running the resulting package against Eunomia
@schuemie @jamieweaver - from our discussion today, I've done the following:
Updated the StdApi libraries so that we can externalize the study specifications in JSON. You'll need to use this branch to make use of the proposed updates to Hydra:
https://github.com/OHDSI/StandardizedAnalysisAPI/tree/hydra-testing
Once you've compiled this branch of StandardizedAnalysisApi, you can use the unit-tests
branch that I just pushed up to this repo. As part of those changes, I've done the following:
- Added an R wrapper function for calling the Hydra Java library to retrieve the JSON specification. This will avoid having to duplicate JSON specifications floating around and keep the specification centralized in the StdApi project.
- Added 2 of the 3 unit tests proposed above. For the "building the resulting package" one, I've attempted to use devtools as described in: https://support.rstudio.com/hc/en-us/articles/200486508-Building-Testing-and-Distributing-Packages. The
load_all
anddev_mode
seem like useful candidates for our work here.
This is still a WIP but wanted to share what I've done thus far for any feedback or revisions.
From meeting 3/9, added additional test to run UnitTestPackage. Need to create a JSON Spec that models the example study from Eunomia:
https://github.com/OHDSI/Eunomia/blob/master/extras/TestCode.R#L105-L191
JSON should reside in the StdApi library so it can be referenced and run by Hydra's unit tests
Added unit tests to hydrate and run each skeleton using renv and Eunomia with the v0.3.0 release.