-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use tests if no internet #379
Comments
@eddelbuettel Hi Dirk. This is the simplest way I found to check if there is access to the internet before performing the test. |
The predicate if (!) { looks good to me! And we already ensure we always have noDNS <- is.null(curl::nslookup("google.com", error = FALSE))
# other predicates ...
if (noDNS) exit_file("Skipping tests for lack of internet")
# ... remainder which would allow us to run some tests but not others. Now, looking at > has_internet()
[1] TRUE
> so the test could be even simpler... |
Sounds good about the has_internet. I have not checked that. Let me change it. I will also check internet before each test. |
Nicely done! |
Thank you, but apparently still failing. I have forwarded you the information. |
Hm, per https://win-builder.r-project.org/incoming_pretest/gtrendsR_1.4.8_20210220_200543/Debian/00check.log you still have the wrong Will try here. Have never ever seen that |
True, I submitted by error before removing this line (which is now ok). But, this is just checking if internet is available before launching the whole series of tests. Do you think this could be the problem? |
I am very confused by this. It also passes here. I just sent it to RHub as well (on one of the Debian boxen). Running now: > check(path="gtrendsR_1.4.8.tar.gz", platform="debian-gcc-release", email="edd@debian.org")
─ Uploading package
─ Preparing build, see status at
https://builder.r-hub.io/status/gtrendsR_1.4.8.tar.gz-745229d17e2c48249fe24ed1a1cc47a8
─ Build started
─ Downloading and unpacking package file
─ Querying system requirements
... On the margin I would recommend skipping tests at CRAN and else where unless an environment variable is set. Say, call it if (Sys.getenv("GTRENDS_RUN_ALL_TESTS", "") == "") exit_file("Skipping tests in limited run.") |
Everything is also fine on my side (including RHub). I like your idea. Can you implement it? |
Sure. Do you have a preferred name for the environment variable? (And for examples you can |
Yes, same for me. If we cannot reproduce the issue we should skip it. You "just" have to remember to set the var at your end when developing. (And maybe set it at Travis or GitHub.) BTW I can also send you a simple PR to do what we did before at Travis now at GitHub with Actions. There is always more but I like to keep it simple and quick... |
I see that you used if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.") I do not have a preferred name, hummm, something as simple as Also ok for your PR, it is a clever idea. While there, any benefits/thoughts on eventually switching to Actions? |
I think I would embed As for Actions, turns out I was in fact wrong and I had no choice as I ran out of credits at Travis. I don't mind Actions, I am not as religious about it as some other people. I blogged about my set up -- now basically the same script at Travis, GitHub Actions or Azure Pipelines. So if one is annoying I can pick the other. I can deal with both over morning coffee tomorrow. Good / soon enough? |
Sounds prefect my friend. As usual, thank you for your help, much appreciated. |
The text was updated successfully, but these errors were encountered: