frontend_tests/run-casper: Move server.log to var/casper.

This commit is contained in:
Taranjeet Singh 2016-07-24 10:32:22 +05:30 committed by Tim Abbott
parent b49b3d5899
commit a131fc74f0
2 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View File

@ -2,7 +2,6 @@
*~
/all_messages_log.*
/event_log/*
frontend_tests/casper_tests/server.log
frontend_tests/casper_lib/test_credentials.js
/prod-static
/errors/*

View File

@ -45,13 +45,15 @@ subprocess.check_call('tools/setup/generate-test-credentials')
subprocess.check_call(['rm', '-f'] + glob.glob('/tmp/casper-failure*.png'))
log = open('frontend_tests/casper_tests/server.log', 'w')
subprocess.check_call(['mkdir', '-p', 'var/casper'])
log = open('var/casper/server.log', 'w')
def assert_server_running(server):
# type: (subprocess.Popen) -> None
"""Get the exit code of the server, or None if it is still running."""
if server.poll() is not None:
raise RuntimeError('Server died unexpectedly! Check frontend_tests/casper_tests/server.log')
raise RuntimeError('Server died unexpectedly! Check var/casper/server.log')
def server_is_up(server):
# type: (subprocess.Popen) -> bool
@ -106,7 +108,7 @@ def run_tests(files):
if ret != 0:
print("""
Oops, the frontend tests failed. Tips for debugging:
* Check the frontend test server logs at frontend_tests/casper_tests/server.log
* Check the frontend test server logs at var/casper/server.log
* Check the screenshots of failed tests at /tmp/casper-failure*.png
* Try remote debugging the test web browser as described in docs/testing.rst
""", file=sys.stderr)