r-lib / testthat

An R 📦 to make testing 😀
https://testthat.r-lib.org
Other
888 stars 318 forks source link

Make skip_if_offline() more robust by checking multiple hosts #1890

Closed jdblischak closed 10 months ago

jdblischak commented 11 months ago

r-project.org has been down all morning, which is causing my package tests to be skipped. This PR updates skip_if_offline() to check multiple hosts, and returns TRUE on the first connection. It's backwards compatible because it still works when provided a single domain to host. And it will be just as fast once r-project.org is restored.

I added github.com since it's hard to get much done anyways when GitHub is down. And I added captive.apple.com because I learned from sindresorhus/is-online that this is how iOS determines internet connectivity, so it should have a very reliable uptime.

If you are open to this update, I'll add an entry to NEWS.md

hadley commented 10 months ago

Let's begin by just swapping r-project.org out for captive.apple.com. I think that's a minimal change that helps the default use case; but in general I do think you should be specifying the specific site you care about here.

jdblischak commented 10 months ago

Let's begin by just swapping r-project.org out for captive.apple.com

Works for me. And I see that you already made this change and added the NEWS bullet. Thanks!