test: add webserver config and change conn.py

This commit is contained in:
bodong.ybd 2024-12-06 19:30:23 +08:00
parent 9b7d8d367b
commit 1aacbb126c
2 changed files with 6 additions and 10 deletions

11
conn.py
View File

@ -1,4 +1,3 @@
import threading
import time
import yaml
import subprocess
@ -113,14 +112,8 @@ def main():
logging.error("Failed to update or install packages. Exiting...")
exit(1)
logging.info("Starting test thread")
test_thread = threading.Thread(target=run_tests)
test_thread.start()
test_thread.join(timeout=300)
if test_thread.is_alive():
logging.error("Test timed out. Exiting...")
exit(1)
logging.info("Running tests")
run_tests()
commit_and_push_results()
git_push_with_retry()

View File

@ -329,7 +329,8 @@ def run_test_by_configfile():
logfile = None
# now we generate index.html
generate_html_report(logdir, configs)
start_webserver(logdir)
if args.webserver:
start_webserver(logdir)
def create_client(host, port, password, ssl, cluster):
@ -365,6 +366,8 @@ def parse_args():
parser.add_argument("--cluster", help="server is a node of the Redis cluster", default=False, action="store_true")
parser.add_argument("--ssl", help="open ssl connection", default=False, action="store_true")
parser.add_argument("--genhtml", help="generate test report in html format", default=False, action="store_true")
parser.add_argument("--webserver", help="start a web server to show the test report", default=False,
action="store_true")
return parser.parse_args()