From 0a73abbbfe05651d7ffddb516599fb5ac0670a6c Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula <85502298+pokeeffe-molecula@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:34:45 -0500 Subject: [PATCH] Add a smoke test for the sql3 endpoint (#2214) * turned on sql endpoint in smoke test; added a test to execute a simple sql statement * add config to both configs * fixed not enough arraying --- qa/scripts/utilCluster.sh | 7 +++++++ qa/testcases/smoketest/test_smoke.py | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/qa/scripts/utilCluster.sh b/qa/scripts/utilCluster.sh index 9834f6697..4acd08c2b 100755 --- a/qa/scripts/utilCluster.sh +++ b/qa/scripts/utilCluster.sh @@ -123,6 +123,10 @@ long-query-time = "10s" permissions = "/etc/permissions.yml" query-log-path = "/data/featurebase/query.log" configured-ips = ["${DEPLOYED_INGEST_IPS}"] + +[sql] + endpoint-enabled = true + EOT echo "writing the permissions file" @@ -160,6 +164,9 @@ long-query-time = "10s" [metric] service = "prometheus" +[sql] + endpoint-enabled = true + EOT fi diff --git a/qa/testcases/smoketest/test_smoke.py b/qa/testcases/smoketest/test_smoke.py index 81ad0e273..2d38b686c 100644 --- a/qa/testcases/smoketest/test_smoke.py +++ b/qa/testcases/smoketest/test_smoke.py @@ -37,7 +37,15 @@ def test_api_is_responding(): resp_body = response.json() assert resp_body['state'] == "NORMAL" - + +def test_sql3_is_responding(): + response = requests.post("http://" + config.datanode0 + ":10101/sql", data = "select 1") + assert response.status_code == 200 + assert response.headers["Content-Type"] == "application/json" + resp_body = response.json() + assert resp_body['schema']['fields'][0]['type'] == "INT" + assert resp_body['data'][0][0] == 1 + def test_get_index_api(): response = requests.get("http://" + config.datanode0 + ":10101/index/user") assert response.status_code == 200