Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

run Gittip 90 #2057

Closed
chadwhitacre opened this issue Feb 20, 2014 · 20 comments
Closed

run Gittip 90 #2057

chadwhitacre opened this issue Feb 20, 2014 · 20 comments

Comments

@chadwhitacre
Copy link
Contributor

89

@chadwhitacre
Copy link
Contributor Author

Reviewed 71 accounts.

@chadwhitacre
Copy link
Contributor Author

Droplet spun up and updating ...

@chadwhitacre
Copy link
Contributor Author

Backup taken and verified.

@chadwhitacre
Copy link
Contributor Author

Droplet updated.

@chadwhitacre
Copy link
Contributor Author

Ready? Will #2036 regressions bite us? 👹

@clone1018
Copy link
Contributor

Wow, didn't realize we merged that :)

Good luck!

@chadwhitacre
Copy link
Contributor Author

Thanks. :-)

pid-1309 thread-140639092233984 (MainThread) Traceback (most recent call last):
pid-1309 thread-140639092233984 (MainThread)   File "/home/whit537/www.gittip.com/gittip/cli.py", line 32, in payday
pid-1309 thread-140639092233984 (MainThread)     Payday(db).run()
pid-1309 thread-140639092233984 (MainThread)   File "/home/whit537/www.gittip.com/gittip/billing/payday.py", line 137, in run
pid-1309 thread-140639092233984 (MainThread)     self.payin(ts_start, self.genparticipants(ts_start, ts_start))
pid-1309 thread-140639092233984 (MainThread)   File "/home/whit537/www.gittip.com/gittip/billing/payday.py", line 231, in payin
pid-1309 thread-140639092233984 (MainThread)     self.charge_and_or_transfer(ts_start, participant, tips, total)
pid-1309 thread-140639092233984 (MainThread)   File "/home/whit537/www.gittip.com/gittip/billing/payday.py", line 300, in charge_and_or_transfer
pid-1309 thread-140639092233984 (MainThread)     self.charge(participant, short)
pid-1309 thread-140639092233984 (MainThread)   File "/home/whit537/www.gittip.com/gittip/billing/payday.py", line 550, in charge
pid-1309 thread-140639092233984 (MainThread)     , amount
pid-1309 thread-140639092233984 (MainThread)   File "/home/whit537/www.gittip.com/gittip/billing/payday.py", line 658, in charge_on_balanced
pid-1309 thread-140639092233984 (MainThread)     customer.cards.one().debit(amount=cents, description=username)
pid-1309 thread-140639092233984 (MainThread)   File "/home/whit537/www.gittip.com/env/local/lib/python2.7/site-packages/wac.py", line 788, in one
pid-1309 thread-140639092233984 (MainThread)     raise NoResultFound()
pid-1309 thread-140639092233984 (MainThread) NoResultFound

@chadwhitacre
Copy link
Contributor Author

So we're try/excepting for balanced.exc.HTTPError. Does that still exist, @matthewfl? What other errors besides NoResultFound will wac raise? Is there a base class we can catch?

chadwhitacre added a commit that referenced this issue Feb 20, 2014
In #2036 we started using VCR to freeze HTTP API calls into test
fixtures. This is great! Let's do more of that! This commit moves the
VCR configuration upstream from where it began (in test_billing.py) into
the gittip.testing.Harness class. Now all tests can make expensive HTTP
API calls with impunity. In fact, this knocks out a XXX comment, because
we had one API call elsewhere in the test suite. VCR transparently took
care of it for us! I was quite pleasantly surprised to find
TestPages.yml. Yay VCR! :-)

My first motivation in doing this, however, was to be able to write a
test for regression I'm seeing with payday (#2057). Onward!
chadwhitacre added a commit that referenced this issue Feb 20, 2014
Picking up from #2059, this commit refactors the existing tests for
charge_on_balanced (which is where the bug in #2057 lives) to use VCR
instead of mock objects. I was hoping it would make the tests cleaner
but it looks like I don't quite fully understand how to use VCR yet. :-/
@matthewfl
Copy link
Contributor

@whit537 https://github.com/bninja/wac/blob/master/wac.py

wac is based off requests, so I am assuming that HTTPError is going to be the base error for when making requests

as for wac, it appears that it does not have a base exception :/ https://github.com/bninja/wac/blob/master/wac.py#L543

@chadwhitacre
Copy link
Contributor Author

Okay! I'm ready to rerun payday using ea9d1dd (PR #2064).

@chadwhitacre
Copy link
Contributor Author

@matthewfl Yeah, I ended up going with a blank try/except around Balanced API usage during payday. Better safe than sorry. :-)

@chadwhitacre
Copy link
Contributor Author

Rebuilding droplet ...

@chadwhitacre
Copy link
Contributor Author

Script restarted! 😱

@chadwhitacre
Copy link
Contributor Author

Seems to be running okay. The users that we choked on before are now reporting NoResultFound() in the log, as expected. I spot checked the dashboard and history page, and I'm seeing charges showing up.

@chadwhitacre
Copy link
Contributor Author

Script ran for {age} (2:50:23.196630).

@chadwhitacre
Copy link
Contributor Author

Repaired paydays table per #261 (needed because of restart).

@chadwhitacre
Copy link
Contributor Author

Tweet tweeted on Twitter.

@chadwhitacre
Copy link
Contributor Author

Log downloaded and droplet destroyed.

@chadwhitacre
Copy link
Contributor Author

Escrow shuffled.

@chadwhitacre
Copy link
Contributor Author

Okay! 💃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants