From 458f156bb4b81ff91ecb059a59361b4e2d85ae56 Mon Sep 17 00:00:00 2001 From: zhihanz Date: Thu, 19 May 2022 14:17:09 +0800 Subject: [PATCH] add feature flagging for logic tst --- tests/logictest/config.py | 8 ++++++-- tests/logictest/main.py | 21 +++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tests/logictest/config.py b/tests/logictest/config.py index edab6f0a8fc4..d55638a5dcde 100644 --- a/tests/logictest/config.py +++ b/tests/logictest/config.py @@ -23,11 +23,15 @@ def config_from_env(): mysql_port = os.getenv("QUERY_MYSQL_HANDLER_PORT") if mysql_port is not None: - mysql_config['port'] = mysql_port + mysql_config['port'] = int(mysql_port) + + http_host = os.getenv("QUERY_HTTP_HANDLER_HOST") + if http_host is not None: + http_config["host"] = http_host http_port = os.getenv("QUERY_HTTP_HANDLER_PORT") if http_port is not None: - http_config['port'] = http_port + http_config['port'] = int(http_port) mysql_database = os.getenv("MYSQL_DATABASE") if mysql_database is not None: diff --git a/tests/logictest/main.py b/tests/logictest/main.py index 3f34541ca857..92201f0bffca 100644 --- a/tests/logictest/main.py +++ b/tests/logictest/main.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- coding: UTF-8 -*- +import os from mysql_runner import TestMySQL from http_runner import TestHttp @@ -7,12 +8,16 @@ from config import mysql_config, http_config if __name__ == '__main__': - mySQL = TestMySQL("mysql") - mySQL.set_driver(mysql_config) - mySQL.set_label("mysql") - mySQL.run_sql_suite() + disable_mysql_test = os.getenv("DISABLE_MYSQL_LOGIC_TEST") + if disable_mysql_test is not None: + mySQL = TestMySQL("mysql") + mySQL.set_driver(mysql_config) + mySQL.set_label("mysql") + mySQL.run_sql_suite() - http = TestHttp("http") - http.set_driver(http_config) - http.set_label("http") - http.run_sql_suite() + disable_http_test = os.getenv("DISABLE_HTTP_LOGIC_TEST") + if disable_http_test is not None: + http = TestHttp("http") + http.set_driver(http_config) + http.set_label("http") + http.run_sql_suite()