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

Policy re: examples and tests #36

Closed
jennybc opened this issue Jan 16, 2015 · 4 comments
Closed

Policy re: examples and tests #36

jennybc opened this issue Jan 16, 2015 · 4 comments

Comments

@jennybc
Copy link
Contributor

jennybc commented Jan 16, 2015

API wrapping packages present headaches in terms of runnable examples and tests. They can be slow and there are myriad reasons why they might not work, that don't necessarily reveal a fundamental problem.

Do you have any Big Picture "policy thoughts" before I even contemplate adding examples to function docs or putting some real tests in?

@cscheid
Copy link
Owner

cscheid commented Jan 16, 2015

This is all really ugly, you're right.

What I really would like to get right is testing the paths that require authentication.

I have thought of using some of Hadley's infrastructure for testing using private tokens via encrypted key-value pairs on the travis configuration file, but I haven't tried that yet. RGithub's develop branch needs merging, but it has the travis configuration file. The idea would be to get an authentication token by decrypting the values in Travis, and then running real tests against GitHub's API (create.gist, etc.)

These would necessarily be slow, but the only alternative that I can think of is mocking the entire GitHub backend. (That's impractical, of course.)

I really don't know how people write test suites for API wrappers, to be honest.

What do you think?

@jennybc
Copy link
Contributor Author

jennybc commented Jan 16, 2015

I am working on a package to wrap the Google spreadsheets API (or rather, someone working for me is doing the grunt work 😄 ) and we are confronting many of the same issues. This was just a probe to see if you had some pre-existing master plan 😄 I don't have any real answers either.

But I do propose not waiting for the glorious but complicated stuff you describe above to start adding tests. What if I just started to gradually put in tests where possible, i.e. where authentication is not needed?

I have done some informal testing of my own using a test Organization, because my current crisis is a need to create many Teams and repos and create associations between them. Seems like GitHub needs some dummy repos and Organizations and users where you can count on various properties and build tests around querying them! Won't help for creating repos, Teams, etc. though.

@cscheid
Copy link
Owner

cscheid commented Jan 16, 2015

What if I just started to gradually put in tests where possible, i.e. where authentication is not needed?

That would be enourmously helpful.

@cscheid
Copy link
Owner

cscheid commented Apr 24, 2015

I'm going to close this, since half of it is going to #48, and I just created #49 for the other half.

@cscheid cscheid closed this as completed Apr 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants