Closed pbchase closed 3 months ago
@saipavan10-git, this is easier to review and test than it used to be, but it is still hard to review. The goal was to refactor create_and_send_new_redcap_prod_per_project_line_items.R
to make it smaller and more of its code testable. I did that in this PR and added the tests on all the new functions.
Yet testing the ETL script itself is still hard. To test it against prod risks creating and sending new bills. The ETL still retains all of the steps that write to the database. There is some interleave between those and the new function calls and other code.
You could test against another database, but that requires cloning several production tables to an in-memory DB. OTOH, I am much more skilled in cloning tables a vector of tables in R than I used to be. I could show you how to do that. I have a recipe for that but I haven't written that down anywhere. It's documented best in the code that makes the test data and the code in the tests that reads it back. You can certainly see that in this PR.
We could go over that tomorrow in our 2 p.m. if you like. Would that work for you?
Sure that works.
Address issue #228