mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 14:08:23 +00:00
tests: Add --force option to tools/test-help-documentation.py
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
import optparse
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -19,6 +20,11 @@ except ImportError as e:
|
|||||||
|
|
||||||
os.environ["EXTERNAL_HOST"] = "localhost:9981"
|
os.environ["EXTERNAL_HOST"] = "localhost:9981"
|
||||||
|
|
||||||
|
parser = optparse.OptionParser()
|
||||||
|
parser.add_option('--force', default=False,
|
||||||
|
action="store_true",
|
||||||
|
help='Run tests despite possible problems.')
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
def assert_server_running(server):
|
def assert_server_running(server):
|
||||||
# type: (subprocess.Popen) -> None
|
# type: (subprocess.Popen) -> None
|
||||||
@@ -45,7 +51,12 @@ if os.path.exists(LOG_FILE) and os.path.getsize(LOG_FILE) < 100000:
|
|||||||
log.write('\n\n')
|
log.write('\n\n')
|
||||||
else:
|
else:
|
||||||
log = open(LOG_FILE, 'w')
|
log = open(LOG_FILE, 'w')
|
||||||
server = subprocess.Popen(('tools/run-dev.py', '--test'), stdout=log, stderr=log)
|
|
||||||
|
run_dev_server_command = ['tools/run-dev.py', '--test']
|
||||||
|
if options.force:
|
||||||
|
run_dev_server_command.append('--force')
|
||||||
|
server = subprocess.Popen(run_dev_server_command, stdout=log, stderr=log)
|
||||||
|
|
||||||
sys.stdout.write('Waiting for test server')
|
sys.stdout.write('Waiting for test server')
|
||||||
try:
|
try:
|
||||||
while not server_is_up(server):
|
while not server_is_up(server):
|
||||||
|
|||||||
Reference in New Issue
Block a user