In our company we have several packages that work together. We have written two types of tests, which we keep in 2 files:
- a test file for the specific package ( specific.R ). These tests are very quick (I guess these are traditional
- and one that we use to make sure all packages continue to work together and the overall result is fine ( overall.R ). These tests take a long time because we have to ensure that ALL steps of the process work for ALL the projects in the company (I guess these are traditional
Both tests are currently run when we push to github or create a PR through Travis, which implicitly runs this line of code(
R CMD check *tar.gz ). As you well know, this runs all the tests in the testthat folder, and thus both files are run.
Now, we would like to choose which tests run when so that integration tests only run when we do a Pull-Request to the package (when we have introduced new functionality on a different dev branch) while the package-specific unit tests keep running every time we commit/push to the repo. We see in Create a new configurable cron job with travis that there is an event type
TRAVIS_EVENT_TYPE through which we could distinguish different runs… would it be possible to perhaps rename the overall test file to
.RignoreMe for normal runs and then
if TRAVIS_EVENT_TYPE: "pull-request" rename *.RignoreMe *.R or some such?
Does this functionality make sense? It’s weird to me that I haven’t found more people trying to accomplish the same.