Hello all! I have a package where I have some “golden files” that I use as references in my test suite. I’m trying to add a function to update all of the golden files, for developers to use whenever something like an external dependency or API changes.
So my question: is there a standard place to put a function like this in an R package? This article describes doing it in a Go package, by using flag to ‘go test’, but I'm pretty sure that's not a good approach for R.
Someone threw out the idea of keeping the script in ‘raw-data’ which might work. Any other ideas? Someone else mentioned putting it in ‘inst/script’ and then including that folder in .Rbuildignore since it is only a dev function, not user-facing.
To reiterate, this is a script that would be run manually by developers when something in the code changed and the test data needed to be updated. It is not actually part of the test suite.
I’ve looked around a bit and can’t seem to find a recommended pattern for this. Any thoughts or ideas are welcome.