mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
bin/run-all-tests.sh provides a convenient way to repeat running the same test multiple times by setting NUM_TEST_ITERATIONS env var. This is especially useful to prove that a test is not flaky. However, it will still redundantly repeat run-workload.py and verifiers without any way to skip them. This patch adds env var SKIP_VERIFIERS to allow skipping verifiers. "Run test run-workload" is rewritten into its own test_run_workload.py. Testing: - Run and pass test_run_workload.py. - Manually run the script with SKIP_VERIFIERS set to true and confirm that verifiers are skipped. Change-Id: Ib483dcd48980655e4aa0c77f1cdc1f2a3c40a1de Reviewed-on: http://gerrit.cloudera.org:8080/22365 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
59 lines
2.2 KiB
Python
59 lines
2.2 KiB
Python
# Licensed to the Apache Software Foundation (ASF) under one
|
|
# or more contributor license agreements. See the NOTICE file
|
|
# distributed with this work for additional information
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
# to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance
|
|
# with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing,
|
|
# software distributed under the License is distributed on an
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
# KIND, either express or implied. See the License for the
|
|
# specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from __future__ import absolute_import
|
|
import os
|
|
from subprocess import check_output
|
|
|
|
from tests.common.base_test_suite import BaseTestSuite
|
|
|
|
|
|
class TestRunWorkload(BaseTestSuite):
|
|
|
|
def test_run_workload(self):
|
|
"""Test that bin/run-workload.py still works."""
|
|
impala_home = os.getenv('IMPALA_HOME')
|
|
cmd = [
|
|
os.path.join(impala_home, 'bin/run-workload.py'), '-w', 'tpch', '--num_clients=2',
|
|
'--query_names=TPCH-Q1', '--table_format=text/none',
|
|
'--exec_options=disable_codegen:False']
|
|
kerberos_arg = os.getenv('KERB_ARGS')
|
|
if kerberos_arg is not None:
|
|
cmd.append(kerberos_arg)
|
|
output = check_output(cmd, universal_newlines=True)
|
|
|
|
"""
|
|
Full stdout is like this:
|
|
|
|
Workload: TPCH, Scale Factor:
|
|
|
|
Table Format: text/none/none
|
|
+---------+---------------------+----------------+-----------+
|
|
| Query | Start Time | Time Taken (s) | Client ID |
|
|
+---------+---------------------+----------------+-----------+
|
|
| TPCH-Q1 | 2025-01-27 15:40:28 | 5.59 | 1 |
|
|
| TPCH-Q1 | 2025-01-27 15:40:28 | 5.65 | 2 |
|
|
+---------+---------------------+----------------+-----------+
|
|
"""
|
|
assert "Workload: TPCH, Scale Factor:" in output
|
|
assert "Table Format: text/none/none" in output
|
|
assert "Query" in output
|
|
assert "Start Time" in output
|
|
assert "Time Taken (s)" in output
|
|
assert "Client ID" in output
|
|
assert "TPCH-Q1" in output
|