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

[#747] auto-test exits with status code 1 if tests fail #295

Merged
merged 1 commit into from Aug 8, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions framework/pym/play/commands/base.py
Expand Up @@ -213,7 +213,7 @@ def autotest(app, args):
line = soutint.readline().strip()
if line:
print line
if line.find('/@tests to run the tests') > -1:
if line.find('Listening for HTTP') > -1:
soutint.close()
break

Expand All @@ -237,12 +237,6 @@ def autotest(app, args):

print "~"
time.sleep(1)
if os.path.exists(os.path.join(app.path, 'test-result/result.passed')):
print "~ All tests passed"
print "~"
if os.path.exists(os.path.join(app.path, 'test-result/result.failed')):
print "~ Some tests have failed. See file://%s for results" % test_result
print "~"

# Kill if exists
http_port = app.readConf('http.port')
Expand All @@ -252,6 +246,15 @@ def autotest(app, args):
opener.open('%s://localhost:%s/@kill' % (protocol, http_port))
except Exception, e:
pass

if os.path.exists(os.path.join(app.path, 'test-result/result.passed')):
print "~ All tests passed"
print "~"
testspassed = True
if os.path.exists(os.path.join(app.path, 'test-result/result.failed')):
print "~ Some tests have failed. See file://%s for results" % test_result
print "~"
sys.exit(1)

def id(play_env):
if not play_env["id"]:
Expand Down