Skip to content
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

Develop a way to have TravisCI access tokens for categorize_dataset() testing #205

Open
laijasmine opened this issue Jun 19, 2020 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@laijasmine
Copy link

For now the categorize_dataset() tests are not run in TravisCI to avoid having to figure out tokens

Helpful tutorial:
https://gargle.r-lib.org/articles/articles/managing-tokens-securely.html

Not sure how we will incorporate the service account managed via the Google API / Cloud Platform console to access the token to googlesheets

@laijasmine laijasmine added the help wanted Extra attention is needed label Jun 19, 2020
@ThomasThelen
Copy link
Member

You might want to look into a mocking library for this. I don't think that CRAN allows packages to access the internet in their build system so it's not a horrible idea.

For example to mock the auth stuff. Run the function (outside of the unit test) and use your credentials, but capture the output. Then, in the unit test mock googlesheets4::gs4_auth to return the output that you saved from before. Now when the unit test hits that piece of code, it replaces googlesheets4::gs4_auth with your custom return, which makes it look like the web request worked.

You'd also want to do the same with solr <- dataone::query. Capture the output in the browser, and mock dataone::query. When dataone:query gets called, make it return the same stuff in the browser (probably json).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants