getwilds / cancerprof

API Client for State Cancer Profiles
http://getwilds.org/cancerprof/
Other
2 stars 3 forks source link

When to skip certain tests #51

Closed seankross closed 7 months ago

seankross commented 7 months ago

My instinct is that there are certain situations where you should skip the tests that send a request to the API. Likely these tests should be skipped on CRAN. @sckott What do you think of that assessment?

sckott commented 7 months ago

Yeah, i think skip ANY tests that do http requests on CRAN. If you don't they'll be intermittent issues or more permanent issues that cause tests to fail because of the website changing anything, they may have downtime for even 10 mintues and cran checks could run during that time.

I would still have some tests that run on cran (ones that do not do http requests, and to the best of your knowledge will not fail), but i would not treat cran checks as another CI service, but rather as something to minimize interaction with at all costs because it is so tedious/painful to do anything CRAN related.

seankross commented 7 months ago

Brian you'll need to go through every that_that() test and make sure that for the tests that query the API you add skip_on_cran() to the first line of the test, like so:

test_that("Output data type is correct", {
  skip_on_cran()
  output <- demo_crowding(area = "wa",
                          areatype = "hsa", 
                          crowding = "household with >1 person per room",
                          race = "All Races (includes Hispanic)")

  expect_true(inherits(output, "data.frame"))
})