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

Added method to list authorizations #481

Merged

Conversation

martinvanzijl
Copy link
Contributor

Fixes issue #459.

Added method GitHub.listMyAuthorizations().

Copy link
Member

@bitwiseman bitwiseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! How about some tests as well?

bitwiseman and others added 3 commits October 4, 2019 00:43
- Added missing brace at end of listMyAuthorizations().
- Added unit test for listMyAuthorizations().
@martinvanzijl
Copy link
Contributor Author

@bitwiseman I added a basic unit test. Can you please check?

I'm not sure how to check that the authorizations themselves are correct, since they depend on the user running the test. Can I change to a "known user" in the test itself?

@bitwiseman
Copy link
Member

@martinvanzijl
TL;DR - What you've written is good enough.

Kohsuke had a separate dummy login that he used for this, but that doesn't scale to more people. Where possible I'd like tests to use the github-api-test-org since multiple people can use it interchangeably. what that isn't possible (as here), then the snapshot you take is good enough. The snapshot becomes the "known user"/stable data. 😄

You can then add checks against that stable data and anyone running the test should get the same result. Maybe mark the test using the snapshotNotAllowed() method and explain why.

FYI: I'd like to have robust tests that can be re-snapshotted freely, but if that can't be accomplished without a lot of extra work, I'm okay with tests that verify the functionality in CI using canned data that may require work to update if the tests change.

@bitwiseman bitwiseman merged commit 7e0d61a into hub4j:master Oct 8, 2019
@bitwiseman bitwiseman removed their request for review October 8, 2019 02:04
@martinvanzijl martinvanzijl deleted the issue_459_list_authorizations branch October 9, 2019 00:17
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

Successfully merging this pull request may close these issues.

2 participants