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
stripe login: poll for api key #4
Conversation
View your build status at https://cibot.corp.stripe.com/builds/pull/git@github.com/stripe/stripe-cli/4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, and I think we need a test for this. Once you make the interval and max attempts values arguments, we can write a test with a short interval and a low max attempts.
You can take a look at e.g. stripeauth/client_test.go
for an example of how to mock a server to test a client.
b550495
to
cf3a7d8
Compare
client := stripeauth.NewHTTPClient("") | ||
|
||
var count = 0 | ||
for count < maxAttempts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a test to verify the polling functionality works right?
cf3a7d8
to
5709422
Compare
ptal @ob-stripe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Sorry for the delay! This looks great, especially the tests! |
Reviewers
r? @ob-stripe @brandonl-stripe
cc @tomer-stripe
Summary
Implements the function to poll for the API key.
A counter for poll attempts is an easier model to implement than a polling timeout.
NB. in a follow-up we can extract the http client rather than simply making the current one public.