test-run-dev: Delete commented-out code.

We don't disable code by commenting it out -- that leaves a mess.
We delete it.  Remembering what the code was is what source control
is for.

This fixes cd849bc3f "test-run-dev: Disable Nagios check."
from a few weeks ago.
This commit is contained in:
Greg Price 2018-01-30 15:57:58 -08:00
parent cad4083987
commit ff8e588340
1 changed files with 1 additions and 34 deletions

View File

@ -36,38 +36,11 @@ def start_server(logfile_name: str) -> Tuple[bool, str]:
return failure, ''.join(datalog)
def test_nagios(nagios_logfile):
# type: (IO[str]) -> bool
ZULIP_DIR = os.path.join(TOOLS_DIR, '..')
API_DIR = os.path.join(ZULIP_DIR, 'api')
os.chdir(API_DIR)
subprocess.call(['./setup.py', 'install'])
PUPPET_DIR = os.path.join(ZULIP_DIR, 'puppet')
os.chdir(ZULIP_DIR)
my_env = os.environ.copy()
my_env['PYTHONPATH'] = ZULIP_DIR
args = [
os.path.join(PUPPET_DIR,
'zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time'),
'--nagios',
'--site=http://127.0.0.1:9991',
]
result = subprocess.check_output(args, env=my_env, universal_newlines=True,
stderr=nagios_logfile)
if result.startswith("OK:"):
return True
print(result)
return False
if __name__ == '__main__':
print("Testing development server start!")
logfile_name = '/tmp/run-dev-output'
logfile = open(logfile_name, 'wb', buffering=0)
# nagios_logfile = open('/tmp/test-nagios-output', 'w+')
args = ["{}/run-dev.py".format(TOOLS_DIR)]
STDOUT = subprocess.STDOUT
@ -75,24 +48,18 @@ if __name__ == '__main__':
try:
failure, log = start_server(logfile_name)
# We have moved API to a separate repo. `test_nagios` and
# `check_send_receive_time` need to be updated.
# failure = failure or not test_nagios(nagios_logfile)
finally:
logfile.close()
# nagios_log = close_and_get_content(nagios_logfile)
run_dev.send_signal(signal.SIGINT)
run_dev.wait()
if not failure and 'Traceback' in log: # + ' ' + nagios_log:
if not failure and 'Traceback' in log:
failure = True
if failure:
print("Development server is not working properly:")
print(log)
# print("check_send_receive_time output:")
# print(nagios_log)
sys.exit(1)
else:
print("Development server is working properly.")