Closed dshemetov closed 2 months ago
Ran into an issue where the CI and my local snapshots disagreed. Ran renv::update()
locally, updated packages, and it seemed to fix it by updating the snapshots. A little concerning that our canned forecasts can change in the 3rd decimal place based on updated dependencies. But at least these snapshots will help us identify when such changes come from our work or from an upstream dependency.
So for each of our canned forecasters, I included the forecast outputs of a few (~default) forecaster (using included JHU data) as snapshots in the tests. Now these tests will compare the output of those forecasts on developer branches and will give us (at least some) confidence we have not altered these forecaster outputs with our code changes. And if the forecasts have changed, you can run testthat::snapshot_review()
to get a nice diff interface, where you can decide whether to accept or reject the new snapshots.
Cool! And it runs on R CMD Check?
Yup, it's part of the tests, so it runs with devtools::test()
too.
Checklist
Please:
DESCRIPTION
andNEWS.md
. Always increment the patch version number (the third number), unless you are making a release PR from dev to main, in which case increment the minor version number (the second number).~~Change explanations for reviewer
Adds snapshot tests. Could add more snapshots with different parameter settings, but I went with a few for now.
Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch