Created
December 8, 2012 03:26
-
-
Save chadwhitacre/4238447 to your computer and use it in GitHub Desktop.
Test Script for https://github.com/whit537/www.gittip.com/issues/413
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -u | |
import commands | |
import os | |
import random | |
import sys | |
import time | |
restart = '-s' in sys.argv | |
if restart: | |
sys.argv.remove('-s') | |
try: | |
nreps = int(sys.argv[1]) | |
except IndexError: | |
nreps = 4 | |
if restart: | |
os.system('cd /Library/PostgreSQL/9.1/ && sudo -u postgres pg_ctl restart -D data') | |
for i in range(nreps): | |
time.sleep(2 * random.random()) | |
output = commands.getoutput('swaddle env ./nosetests test_participant.py') | |
if 'FAILED' in output: | |
assert 'two_dollars' in output, output | |
sys.stdout.write('X') | |
else: | |
assert 'OK' in output, output | |
sys.stdout.write('.') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment