minor, fix smoke test script
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2fc5827f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2fc5827f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2fc5827f Branch: refs/heads/1.5.x-HBase1.x Commit: 2fc5827f0e8c0f4c598bbf28f1ead962e80cdfcd Parents: 42bf1b5 Author: lidongsjtu <lid...@apache.org> Authored: Sat Apr 30 12:28:15 2016 +0800 Committer: lidongsjtu <lid...@apache.org> Committed: Sat Apr 30 12:28:15 2016 +0800 ---------------------------------------------------------------------- build/smoke-test/testQuery.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/2fc5827f/build/smoke-test/testQuery.py ---------------------------------------------------------------------- diff --git a/build/smoke-test/testQuery.py b/build/smoke-test/testQuery.py index 5656e66..72eb80d 100644 --- a/build/smoke-test/testQuery.py +++ b/build/smoke-test/testQuery.py @@ -30,7 +30,7 @@ class testQuery(unittest.TestCase): def tearDown(self): pass - def testBuild(self): + def testQuery(self): base_url = "http://sandbox:7070/kylin/api" url = base_url + "/query" headers = { @@ -43,8 +43,13 @@ class testQuery(unittest.TestCase): index = 0 for sql_file in sql_files: index += 1 - sql_statement = open(sql_file).read().strip() - payload = "{\"sql\": \"" + sql_statement + "\", \"offset\": 0, \"limit\": \"50000\", \"acceptPartial\":false, \"project\":\"learn_kylin\"}" + sql_fp = open(sql_file) + sql_statement = '' + sql_statement_lines = open(sql_file).readlines() + for sql_statement_line in sql_statement_lines: + if not sql_statement_line.startswith('--'): + sql_statement += sql_statement_line.strip() + ' ' + payload = "{\"sql\": \"" + sql_statement.strip() + "\", \"offset\": 0, \"limit\": \"50000\", \"acceptPartial\":false, \"project\":\"learn_kylin\"}" print 'Test Query #' + str(index) + ': \n' + sql_statement response = requests.request("POST", url, data=payload, headers=headers)