-
Notifications
You must be signed in to change notification settings - Fork 83
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
Remove tests that rely on external URLs for CRAN tests (to address CRAN removal) #217
Comments
In separate conversations with humans and ChatGPT4, I think this is the best route for getting back online the fastest. I like ChatGPT's breakdown for splitting up the tests, it's the best reasoning I've seen it use with R code yet: You can structure your tests in a way that allows you to run only certain tests depending on the context (e.g., locally or on a CI system) and to skip tests if certain conditions are not met. Here's a guide to help you organize and control the execution of your tests:
Here's an example of how you might structure your code: Directory Structure
Example Test File with Conditional SkippingIn a test file like # Skip this test on CRAN
skip_on_cran()
# Skip if a certain environment variable is not set
if (Sys.getenv("RUN_EXTERNAL_TESTS") != "true") {
skip("Skipping external tests")
}
# Your actual tests go here
test_that("External API 1 works", {
# Test code here
}) Controlling Tests via Environment VariablesYou can control whether external tests are run by setting an environment variable before running your tests: export RUN_EXTERNAL_TESTS=true
R CMD check . This way, you have fine-grained control over which tests are run in different contexts, and you can easily enable or disable groups of tests. You can also further modularize the tests based on functionality and context, making it easier to maintain and understand the test code. |
Perhaps this should be a separate issue, but I was going to do the work to get on CRAN in this issue. The other thing is that I was going to move @tomschenkjr's name to the contributor section. We discussed this privately and we think this makes sense (assuming that Tom wants to remain as a contributor 🙏). I hate that emoji, but it's how I feel so there. However, that does leave the question of who should be the maintainer. Myself and @nicklucius are the most obvious candidates and I see the key decision points as this:
It's also worth noting that @evejennings has operational authority as my manager. Although she has delegated responsibility for the project to me, she has a critical role in certain aspects of the project with regards to the communication and direction of the package as it fits in with the the strategic planning of our data science practice that she leads. Either way, I have no intention to change our practice around the protected primary branch, which requires review by a second administrator of RSocrata. So unless that changes, there will always be a duality to the maintenance. EDIT: updated Tom's name to his @ |
The documentation on skipping tests differs from what ChatGPT suggested, I don't believe including the skip command at the top of a script will be effective, it must be included within the test blocks themselves. https://r-pkgs.org/testing-advanced.html#sec-testing-advanced-skip-on-cran |
I'm going to say this is closed, although it's impossible to know with complete certainty. |
A hopefully temporary measure may be to remove tests that rely on external websites for purposes of getting RSocrata back online more quickly than addressing the underlying issue documented in #213
The text was updated successfully, but these errors were encountered: