Clean up Python test import statements Many of our test scripts have import statements that look like "from xxx import *". It is a good practice to explicitly name what needs to be imported. This commit implements this practice. Also, unused import statements are removed.
Change-Id: I6a33bb66552ae657d1725f765842f648faeb26a8 Reviewed-on: http://gerrit.cloudera.org:8080/3444 Reviewed-by: Michael Brown <[email protected]> Tested-by: Internal Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/609b8041 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/609b8041 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/609b8041 Branch: refs/heads/master Commit: 609b80410ed96e6b840cf7259444289b39b6f44d Parents: 45740c8 Author: Taras Bobrovytsky <[email protected]> Authored: Tue Jun 21 19:37:11 2016 -0700 Committer: Taras Bobrovytsky <[email protected]> Committed: Fri Jul 15 23:26:18 2016 +0000 ---------------------------------------------------------------------- tests/authorization/test_grant_revoke.py | 5 +-- tests/beeswax/impala_beeswax.py | 7 +--- .../test_catalog_service_client.py | 14 ++++---- tests/catalog_service/test_hms_failure.py | 9 ++--- .../test_large_num_partitions.py | 9 +---- tests/common/base_test_suite.py | 8 ++--- tests/common/custom_cluster_test_suite.py | 1 - tests/common/failure_injector.py | 5 +-- tests/common/impala_cluster.py | 9 +++-- tests/common/impala_connection.py | 10 ++---- tests/common/impala_service.py | 10 ++---- tests/common/impala_test_suite.py | 37 ++++++++++++-------- tests/common/skip.py | 3 +- tests/common/test_dimensions.py | 4 +-- tests/common/test_result_verifier.py | 9 ++--- tests/common/test_vector.py | 4 +-- .../custom_cluster/test_admission_controller.py | 16 ++++----- tests/custom_cluster/test_alloc_fail.py | 3 +- tests/custom_cluster/test_breakpad.py | 7 ++-- tests/custom_cluster/test_client_ssl.py | 1 - tests/custom_cluster/test_delegation.py | 2 +- tests/custom_cluster/test_hdfs_fd_caching.py | 7 +--- tests/custom_cluster/test_insert_behaviour.py | 6 ++-- tests/custom_cluster/test_legacy_joins_aggs.py | 3 -- .../test_parquet_max_page_header.py | 1 - tests/custom_cluster/test_permanent_udfs.py | 4 +-- tests/custom_cluster/test_query_expiration.py | 5 ++- tests/custom_cluster/test_s3a_access.py | 4 +-- tests/custom_cluster/test_scratch_disk.py | 12 +++---- tests/custom_cluster/test_session_expiration.py | 6 ++-- tests/custom_cluster/test_spilling.py | 2 +- tests/data_errors/test_data_errors.py | 4 +-- tests/experiments/test_process_failures.py | 8 +++-- tests/experiments/test_targeted_perf.py | 4 +-- tests/failure/test_failpoints.py | 12 +++---- tests/metadata/test_compute_stats.py | 12 ++++--- tests/metadata/test_ddl.py | 12 +++---- tests/metadata/test_ddl_base.py | 10 +++--- tests/metadata/test_explain.py | 7 ++-- tests/metadata/test_hdfs_encryption.py | 10 +++--- tests/metadata/test_hdfs_permissions.py | 10 +++--- tests/metadata/test_hidden_files.py | 8 +++-- tests/metadata/test_hms_integration.py | 8 +++-- tests/metadata/test_last_ddl_time_update.py | 5 ++- tests/metadata/test_load.py | 2 -- .../metadata/test_metadata_query_statements.py | 10 +++--- tests/metadata/test_partition_metadata.py | 12 ++----- tests/metadata/test_recover_partitions.py | 11 +++--- tests/metadata/test_set.py | 9 +++-- tests/metadata/test_show_create_table.py | 12 +++---- tests/metadata/test_stale_metadata.py | 4 +-- tests/metadata/test_views_compatibility.py | 10 ++++-- tests/performance/query_exec_functions.py | 12 ++----- tests/performance/query_executor.py | 3 -- tests/performance/scheduler.py | 3 +- tests/performance/workload.py | 1 - tests/performance/workload_runner.py | 18 +++++----- tests/query_test/test_aggregation.py | 12 +++---- tests/query_test/test_analytic_tpcds.py | 2 -- tests/query_test/test_avro_schema_resolution.py | 6 +--- tests/query_test/test_cancellation.py | 3 -- tests/query_test/test_chars.py | 10 ++---- tests/query_test/test_compressed_formats.py | 10 +++--- tests/query_test/test_decimal_casting.py | 5 ++- tests/query_test/test_decimal_queries.py | 9 +++-- tests/query_test/test_delimited_text.py | 10 +++--- tests/query_test/test_exprs.py | 6 ++-- tests/query_test/test_hash_join_timer.py | 2 +- tests/query_test/test_hbase_queries.py | 7 ++-- tests/query_test/test_hdfs_caching.py | 17 ++++----- tests/query_test/test_hdfs_fd_caching.py | 11 ++---- tests/query_test/test_insert.py | 22 +++++++----- tests/query_test/test_insert_parquet.py | 14 ++++---- tests/query_test/test_insert_permutation.py | 12 +++---- tests/query_test/test_join_queries.py | 14 +++++--- tests/query_test/test_kudu.py | 6 ++-- tests/query_test/test_limit.py | 8 ++--- tests/query_test/test_mem_usage_scaling.py | 8 ++--- tests/query_test/test_multiple_filesystems.py | 6 ++-- tests/query_test/test_nested_types.py | 8 ++--- tests/query_test/test_partitioning.py | 11 +++--- tests/query_test/test_queries.py | 10 ++---- tests/query_test/test_query_mem_limit.py | 9 +++-- tests/query_test/test_query_opts.py | 5 +-- tests/query_test/test_runtime_filters.py | 4 +-- tests/query_test/test_scanners.py | 20 +++++++---- tests/query_test/test_sort.py | 9 +---- tests/query_test/test_timezones.py | 7 +--- tests/query_test/test_tpcds_queries.py | 8 +++-- tests/query_test/test_tpch_nested_queries.py | 8 ++--- tests/query_test/test_tpch_queries.py | 8 ++--- tests/query_test/test_udfs.py | 11 +++--- tests/shell/test_shell_commandline.py | 8 ++--- tests/shell/test_shell_interactive.py | 8 ++--- tests/statestore/test_statestore.py | 20 +++++------ tests/stress/test_ddl_stress.py | 6 ++-- tests/stress/test_mini_stress.py | 8 ++--- tests/unittests/test_file_parser.py | 6 ++-- tests/unittests/test_result_verifier.py | 4 +-- tests/util/compute_table_stats.py | 5 +-- tests/util/hdfs_util.py | 8 ++--- tests/util/plugin_runner.py | 2 -- tests/util/s3_util.py | 3 +- tests/util/test_file_parser.py | 6 ++-- tests/verifiers/metric_verifier.py | 2 -- tests/verifiers/test_verify_metrics.py | 3 -- 106 files changed, 364 insertions(+), 483 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/authorization/test_grant_revoke.py ---------------------------------------------------------------------- diff --git a/tests/authorization/test_grant_revoke.py b/tests/authorization/test_grant_revoke.py index b51cb77..14e4d23 100644 --- a/tests/authorization/test_grant_revoke.py +++ b/tests/authorization/test_grant_revoke.py @@ -14,17 +14,14 @@ # # Client tests for SQL statement authorization -import pytest -import logging import grp +import pytest from getpass import getuser from os import getenv from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.test_dimensions import create_uncompressed_text_dimension -from tests.util.filesystem_utils import IS_S3 -from tests.util.test_file_parser import QueryTestSectionReader SENTRY_CONFIG_FILE = getenv('IMPALA_HOME') + '/fe/src/test/resources/sentry-site.xml' http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/beeswax/impala_beeswax.py ---------------------------------------------------------------------- diff --git a/tests/beeswax/impala_beeswax.py b/tests/beeswax/impala_beeswax.py index 3496b74..983e1fa 100644 --- a/tests/beeswax/impala_beeswax.py +++ b/tests/beeswax/impala_beeswax.py @@ -11,9 +11,7 @@ # result = client.execute(query_string) # where result is an object of the class ImpalaBeeswaxResult. import time -import sys import shlex -import traceback import getpass import re @@ -26,11 +24,8 @@ try: except ImportError: pass from impala._thrift_gen.ImpalaService import ImpalaService -from impala._thrift_gen.ImpalaService.ImpalaService import (TImpalaQueryOptions, - TResetTableReq) from tests.util.thrift_util import create_transport -from thrift.transport.TSocket import TSocket -from thrift.transport.TTransport import TBufferedTransport, TTransportException +from thrift.transport.TTransport import TTransportException from thrift.protocol import TBinaryProtocol from thrift.Thrift import TApplicationException http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/catalog_service/test_catalog_service_client.py ---------------------------------------------------------------------- diff --git a/tests/catalog_service/test_catalog_service_client.py b/tests/catalog_service/test_catalog_service_client.py index 9ae05c0..1cc05e1 100644 --- a/tests/catalog_service/test_catalog_service_client.py +++ b/tests/catalog_service/test_catalog_service_client.py @@ -16,21 +16,19 @@ import logging import pytest -from tests.common.test_vector import * -from tests.common.test_dimensions import * -from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.impala_cluster import ImpalaCluster from CatalogService import CatalogService -from CatalogService.CatalogService import TGetFunctionsRequest, TGetFunctionsResponse +from CatalogService.CatalogService import TGetFunctionsRequest from ErrorCodes.ttypes import TErrorCode -from Status.ttypes import TStatus -from thrift.transport.TSocket import TSocket from thrift.protocol import TBinaryProtocol -from thrift.transport.TTransport import TBufferedTransport, TTransportException + +from tests.common.impala_cluster import ImpalaCluster +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_dimensions import create_single_exec_option_dimension from tests.util.filesystem_utils import WAREHOUSE from tests.util.thrift_util import create_transport + LOG = logging.getLogger('test_catalog_service_client') # TODO: Add a test that asserts correct/compatible responses http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/catalog_service/test_hms_failure.py ---------------------------------------------------------------------- diff --git a/tests/catalog_service/test_hms_failure.py b/tests/catalog_service/test_hms_failure.py index f5e315f..ed87fa4 100644 --- a/tests/catalog_service/test_hms_failure.py +++ b/tests/catalog_service/test_hms_failure.py @@ -14,16 +14,13 @@ # # Tests to validate the Catalog Service continues to function even if the HMS fails. -import logging import pytest import os from subprocess import check_call -from tests.common.test_vector import * -from tests.common.test_dimensions import * -from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.impala_cluster import ImpalaCluster -from tests.common.skip import SkipIfIsilon + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_dimensions import create_single_exec_option_dimension from tests.util.filesystem_utils import IS_ISILON, IS_LOCAL class TestHiveMetaStoreFailure(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/catalog_service/test_large_num_partitions.py ---------------------------------------------------------------------- diff --git a/tests/catalog_service/test_large_num_partitions.py b/tests/catalog_service/test_large_num_partitions.py index 2ff7faa..d1a98ef 100644 --- a/tests/catalog_service/test_large_num_partitions.py +++ b/tests/catalog_service/test_large_num_partitions.py @@ -15,15 +15,8 @@ # Tests to validate the Catalog Service works properly when partitions # need to be fetched in multiple batches. -import logging -import pytest -import os -from subprocess import call -from tests.common.test_vector import * -from tests.common.test_dimensions import * from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.impala_cluster import ImpalaCluster -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException +from tests.common.test_dimensions import create_single_exec_option_dimension class TestLargeNumPartitions(ImpalaTestSuite): @classmethod http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/base_test_suite.py ---------------------------------------------------------------------- diff --git a/tests/common/base_test_suite.py b/tests/common/base_test_suite.py index 563d20d..a5a3635 100644 --- a/tests/common/base_test_suite.py +++ b/tests/common/base_test_suite.py @@ -2,11 +2,9 @@ # # The base class that should be used for tests. import logging -import os -import pytest -from tests.common.test_dimensions import * -from tests.common.test_result_verifier import * -from tests.common.test_vector import * + +from tests.common.test_vector import TestMatrix + LOG = logging.getLogger('base_test_suite') # Base class for tests. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/custom_cluster_test_suite.py ---------------------------------------------------------------------- diff --git a/tests/common/custom_cluster_test_suite.py b/tests/common/custom_cluster_test_suite.py index c5822e4..8d47cfc 100644 --- a/tests/common/custom_cluster_test_suite.py +++ b/tests/common/custom_cluster_test_suite.py @@ -22,7 +22,6 @@ import re from subprocess import check_call from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.impala_cluster import ImpalaCluster -from tests.common.skip import SkipIfLocal from tests.util.filesystem_utils import IS_LOCAL from time import sleep http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/failure_injector.py ---------------------------------------------------------------------- diff --git a/tests/common/failure_injector.py b/tests/common/failure_injector.py index 34b206b..c914af9 100644 --- a/tests/common/failure_injector.py +++ b/tests/common/failure_injector.py @@ -7,11 +7,8 @@ # The second way this module can be used to to initialize it and call the actions # directly (ex. kill_random_impalad()). This provides a bit more control over exactly # when a failure will happen and is useful for targeted test scenarios. + import logging -import os -import sys -import time -from tests.common.impala_cluster import * from random import choice from threading import Timer http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/impala_cluster.py ---------------------------------------------------------------------- diff --git a/tests/common/impala_cluster.py b/tests/common/impala_cluster.py index 2a8b56c..40db63d 100644 --- a/tests/common/impala_cluster.py +++ b/tests/common/impala_cluster.py @@ -17,14 +17,17 @@ import logging import psutil import socket - from getpass import getuser from random import choice from signal import SIGKILL -from tests.common.impala_service import * -from tests.util.shell_util import exec_process_async, exec_process from time import sleep +from tests.common.impala_service import ( + CatalogdService, + ImpaladService, + StateStoredService) +from tests.util.shell_util import exec_process_async, exec_process + logging.basicConfig(level=logging.ERROR, format='%(threadName)s: %(message)s') LOG = logging.getLogger('impala_cluster') LOG.setLevel(level=logging.DEBUG) http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/impala_connection.py ---------------------------------------------------------------------- diff --git a/tests/common/impala_connection.py b/tests/common/impala_connection.py index d7f24cc..f75ea43 100644 --- a/tests/common/impala_connection.py +++ b/tests/common/impala_connection.py @@ -16,15 +16,11 @@ # in the future will support HS2 connections. Provides tracing around all # operations. -from tests.beeswax.impala_beeswax import ImpalaBeeswaxClient, ImpalaBeeswaxResult -from thrift.transport.TSocket import TSocket -from thrift.protocol import TBinaryProtocol -from thrift.transport.TTransport import TBufferedTransport, TTransportException -from getpass import getuser - import abc import logging -import os + +from tests.beeswax.impala_beeswax import ImpalaBeeswaxClient + LOG = logging.getLogger('impala_connection') console_handler = logging.StreamHandler() http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/impala_service.py ---------------------------------------------------------------------- diff --git a/tests/common/impala_service.py b/tests/common/impala_service.py index 13ac6a3..6243bc4 100644 --- a/tests/common/impala_service.py +++ b/tests/common/impala_service.py @@ -15,19 +15,15 @@ # Basic object model of a Impala Services (impalad + statestored). Provides a way to # programatically interact with the services and perform operations such as querying # the debug webpage, getting metric values, or creating client connections. + import json import logging -import os import re -import sys import urllib - -from collections import defaultdict -from HTMLParser import HTMLParser -from tests.common.impala_connection import ImpalaConnection, create_connection -from tests.common.impala_connection import create_ldap_connection from time import sleep, time +from tests.common.impala_connection import create_connection, create_ldap_connection + logging.basicConfig(level=logging.ERROR, format='%(threadName)s: %(message)s') LOG = logging.getLogger('impala_service') LOG.setLevel(level=logging.DEBUG) http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/impala_test_suite.py ---------------------------------------------------------------------- diff --git a/tests/common/impala_test_suite.py b/tests/common/impala_test_suite.py index c12204c..b85ca74 100644 --- a/tests/common/impala_test_suite.py +++ b/tests/common/impala_test_suite.py @@ -14,39 +14,48 @@ # # The base class that should be used for almost all Impala tests +import grp import logging import os import pprint import pwd import pytest -import grp import re -import string import subprocess import time -from getpass import getuser from functools import wraps -from impala._thrift_gen.ImpalaService.ttypes import TImpalaQueryOptions +from getpass import getuser from random import choice from subprocess import check_call -from tests.common.impala_service import ImpaladService -from tests.common.impala_connection import ImpalaConnection, create_connection -from tests.common.test_dimensions import * -from tests.common.test_result_verifier import * -from tests.common.test_vector import * -from tests.util.test_file_parser import * -from tests.util.thrift_util import create_transport + from tests.common.base_test_suite import BaseTestSuite +from tests.common.impala_connection import create_connection +from tests.common.impala_service import ImpaladService +from tests.common.test_dimensions import ( + ALL_BATCH_SIZES, + ALL_CLUSTER_SIZES, + ALL_DISABLE_CODEGEN_OPTIONS, + ALL_NODES_ONLY, + TableFormatInfo, + create_exec_option_dimension, + get_dataset_from_workload, + load_table_info_dimension) +from tests.common.test_result_verifier import verify_raw_results, verify_runtime_profile +from tests.common.test_vector import TestDimension from tests.performance.query import Query -from tests.performance.query_executor import JdbcQueryExecConfig from tests.performance.query_exec_functions import execute_using_jdbc +from tests.performance.query_executor import JdbcQueryExecConfig +from tests.util.filesystem_utils import IS_S3, S3_BUCKET_NAME from tests.util.hdfs_util import HdfsConfig, get_hdfs_client, get_hdfs_client_from_conf from tests.util.s3_util import S3Client -from tests.util.filesystem_utils import IS_S3, IS_HDFS, S3_BUCKET_NAME +from tests.util.test_file_parser import ( + QueryTestSectionReader, + parse_query_test_file, + write_test_file) +from tests.util.thrift_util import create_transport # Imports required for Hive Metastore Client from hive_metastore import ThriftHiveMetastore -from thrift.transport import TTransport, TSocket from thrift.protocol import TBinaryProtocol logging.basicConfig(level=logging.INFO, format='-- %(message)s') http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/skip.py ---------------------------------------------------------------------- diff --git a/tests/common/skip.py b/tests/common/skip.py index 1fb6ee7..25bb6ad 100644 --- a/tests/common/skip.py +++ b/tests/common/skip.py @@ -17,13 +17,12 @@ # annotate the class or test routine with the marker. # -import re import os import pytest from functools import partial + from tests.common.environ import IMPALAD_BUILD, USING_OLD_AGGS_JOINS from tests.util.filesystem_utils import ( - IS_DEFAULT_FS, IS_ISILON, IS_LOCAL, IS_S3, http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/test_dimensions.py ---------------------------------------------------------------------- diff --git a/tests/common/test_dimensions.py b/tests/common/test_dimensions.py index 9f8ae13..38a881d 100644 --- a/tests/common/test_dimensions.py +++ b/tests/common/test_dimensions.py @@ -1,11 +1,11 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Common test dimensions and associated utility functions. -import logging + import os from itertools import product + from tests.common.test_vector import TestDimension -from os.path import isfile WORKLOAD_DIR = os.environ['IMPALA_WORKLOAD_DIR'] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/test_result_verifier.py ---------------------------------------------------------------------- diff --git a/tests/common/test_result_verifier.py b/tests/common/test_result_verifier.py index 9e0eca8..86db19e 100644 --- a/tests/common/test_result_verifier.py +++ b/tests/common/test_result_verifier.py @@ -1,14 +1,11 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # This modules contians utility functions used to help verify query test results. -# + import logging import math -import os -import pytest -import sys import re -from functools import wraps + from tests.util.test_file_parser import remove_comments logging.basicConfig(level=logging.INFO, format='%(threadName)s: %(message)s') @@ -125,7 +122,7 @@ def try_compile_regex(row_string): pattern = row_string[len(ROW_REGEX_PREFIX_PATTERN):].strip() regex = re.compile(pattern) if regex is None: - assert False, "Invalid row regex specification: %s" % self.row_string + assert False, "Invalid row regex specification: %s" % row_string return regex return None http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/common/test_vector.py ---------------------------------------------------------------------- diff --git a/tests/common/test_vector.py b/tests/common/test_vector.py index e839f5b..5b3ee01 100644 --- a/tests/common/test_vector.py +++ b/tests/common/test_vector.py @@ -37,9 +37,7 @@ # not (v.get_value('col_type') == 'bool and v.get_value('agg_func') == 'sum')) # # Additional examples of usage can be found within the test suites. -import collections -import logging -import os + from itertools import product # A list of test dimension values. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_admission_controller.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_admission_controller.py b/tests/custom_cluster/test_admission_controller.py index dfcdcc7..b4b6015 100644 --- a/tests/custom_cluster/test_admission_controller.py +++ b/tests/custom_cluster/test_admission_controller.py @@ -1,25 +1,25 @@ # Copyright (c) 2014 Cloudera, Inc. All rights reserved. # Tests admission control -import sys +import logging +import os import pytest -import threading import re - +import sys +import threading from time import sleep, time + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.impala_cluster import ImpalaCluster from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.test_dimensions import create_single_exec_option_dimension -from tests.common.test_dimensions import create_uncompressed_text_dimension +from tests.common.test_dimensions import ( + create_single_exec_option_dimension, + create_uncompressed_text_dimension) from tests.common.test_vector import TestDimension from tests.hs2.hs2_test_suite import HS2TestSuite, needs_session from ImpalaService import ImpalaHiveServer2Service from TCLIService import TCLIService -import logging -import os LOG = logging.getLogger('admission_test') http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_alloc_fail.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_alloc_fail.py b/tests/custom_cluster/test_alloc_fail.py index 9021089..58e4778 100644 --- a/tests/custom_cluster/test_alloc_fail.py +++ b/tests/custom_cluster/test_alloc_fail.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import pytest -from copy import deepcopy + from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.skip import SkipIfBuildType http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_breakpad.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_breakpad.py b/tests/custom_cluster/test_breakpad.py index 91a5f9f..787f1f7 100644 --- a/tests/custom_cluster/test_breakpad.py +++ b/tests/custom_cluster/test_breakpad.py @@ -14,18 +14,17 @@ import glob import os -import pytest import psutil +import pytest import shutil import tempfile import time - from resource import setrlimit, RLIMIT_CORE, RLIM_INFINITY -from signal import SIGKILL, SIGSEGV, SIGUSR1 -from tests.common.skip import SkipIfBuildType +from signal import SIGSEGV, SIGKILL, SIGUSR1 from subprocess import CalledProcessError from tests.common.custom_cluster_test_suite import CustomClusterTestSuite +from tests.common.skip import SkipIfBuildType DAEMONS = ['impalad', 'statestored', 'catalogd'] DAEMON_ARGS = ['impalad_args', 'state_store_args', 'catalogd_args'] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_client_ssl.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_client_ssl.py b/tests/custom_cluster/test_client_ssl.py index 6f8a01c..4276505 100644 --- a/tests/custom_cluster/test_client_ssl.py +++ b/tests/custom_cluster/test_client_ssl.py @@ -23,7 +23,6 @@ import time from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.impala_service import ImpaladService from tests.shell.util import run_impala_shell_cmd, ImpalaShell -from tests.common.impala_cluster import ImpalaCluster class TestClientSsl(CustomClusterTestSuite): """Tests for a client using SSL (particularly, the Impala Shell) """ http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_delegation.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_delegation.py b/tests/custom_cluster/test_delegation.py index 6991ac3..542ebab 100644 --- a/tests/custom_cluster/test_delegation.py +++ b/tests/custom_cluster/test_delegation.py @@ -15,7 +15,7 @@ import getpass import pytest from tests.hs2.hs2_test_suite import HS2TestSuite, needs_session -from TCLIService import TCLIService, constants +from TCLIService import TCLIService from tests.common.custom_cluster_test_suite import CustomClusterTestSuite USER_NAME = getpass.getuser() http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_hdfs_fd_caching.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_hdfs_fd_caching.py b/tests/custom_cluster/test_hdfs_fd_caching.py index b113507..27fc54d 100644 --- a/tests/custom_cluster/test_hdfs_fd_caching.py +++ b/tests/custom_cluster/test_hdfs_fd_caching.py @@ -12,14 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import pytest + from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.impala_cluster import ImpalaCluster -from tests.common.skip import SkipIfLocal -from tests.common.test_dimensions import (TestDimension, - create_single_exec_option_dimension, - create_parquet_dimension) from tests.common.skip import SkipIfS3 @SkipIfS3.caching http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_insert_behaviour.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_insert_behaviour.py b/tests/custom_cluster/test_insert_behaviour.py index 0f92cda..a3bad66 100644 --- a/tests/custom_cluster/test_insert_behaviour.py +++ b/tests/custom_cluster/test_insert_behaviour.py @@ -11,11 +11,11 @@ # 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. -# -import os + import pytest + from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.skip import SkipIfS3, SkipIfLocal from tests.util.filesystem_utils import IS_ISILON, WAREHOUSE from tests.util.hdfs_util import HdfsConfig, get_hdfs_client, get_hdfs_client_from_conf http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_legacy_joins_aggs.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_legacy_joins_aggs.py b/tests/custom_cluster/test_legacy_joins_aggs.py index 19c4cae..c37638f 100644 --- a/tests/custom_cluster/test_legacy_joins_aggs.py +++ b/tests/custom_cluster/test_legacy_joins_aggs.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -import pytest -from copy import deepcopy from tests.common.custom_cluster_test_suite import CustomClusterTestSuite class TestLegacyJoinsAggs(CustomClusterTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_parquet_max_page_header.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_parquet_max_page_header.py b/tests/custom_cluster/test_parquet_max_page_header.py index 8eaf64b..1391e05 100644 --- a/tests/custom_cluster/test_parquet_max_page_header.py +++ b/tests/custom_cluster/test_parquet_max_page_header.py @@ -21,7 +21,6 @@ import string import subprocess from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.impala_cluster import ImpalaCluster from tests.common.skip import SkipIfS3, SkipIfIsilon class TestParquetMaxPageHeader(CustomClusterTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_permanent_udfs.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_permanent_udfs.py b/tests/custom_cluster/test_permanent_udfs.py index 6a01b23..0b48e10 100644 --- a/tests/custom_cluster/test_permanent_udfs.py +++ b/tests/custom_cluster/test_permanent_udfs.py @@ -11,14 +11,14 @@ # 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. -# import os import pytest import subprocess -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException + from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.test_dimensions import create_uncompressed_text_dimension from tests.util.filesystem_utils import get_fs_path class TestUdfPersistence(CustomClusterTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_query_expiration.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_query_expiration.py b/tests/custom_cluster/test_query_expiration.py index 20037cb..8aa198f 100644 --- a/tests/custom_cluster/test_query_expiration.py +++ b/tests/custom_cluster/test_query_expiration.py @@ -16,10 +16,9 @@ import pytest import threading -from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.custom_cluster_test_suite import NUM_SUBSCRIBERS, CLUSTER_SIZE from time import sleep, time -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException + +from tests.common.custom_cluster_test_suite import CustomClusterTestSuite class TestQueryExpiration(CustomClusterTestSuite): """Tests query expiration logic""" http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_s3a_access.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_s3a_access.py b/tests/custom_cluster/test_s3a_access.py index 6877811..d8b35fa 100644 --- a/tests/custom_cluster/test_s3a_access.py +++ b/tests/custom_cluster/test_s3a_access.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import getpass -import pytest import os +import pytest import stat import tempfile + from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.skip import SkipIf from tests.util.filesystem_utils import WAREHOUSE http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_scratch_disk.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_scratch_disk.py b/tests/custom_cluster/test_scratch_disk.py index 7a48f1a..b0437ec 100644 --- a/tests/custom_cluster/test_scratch_disk.py +++ b/tests/custom_cluster/test_scratch_disk.py @@ -14,18 +14,14 @@ # # Tests for query expiration. +import os import pytest -import threading -from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.custom_cluster_test_suite import NUM_SUBSCRIBERS, CLUSTER_SIZE -from time import sleep, time -import stat -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException import shutil -import os -import random +import stat import tempfile +from tests.common.custom_cluster_test_suite import CustomClusterTestSuite + class TestScratchDir(CustomClusterTestSuite): # Query with order by requires spill to disk if intermediate results don't fit in mem http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_session_expiration.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_session_expiration.py b/tests/custom_cluster/test_session_expiration.py index a467b35..f505ecf 100644 --- a/tests/custom_cluster/test_session_expiration.py +++ b/tests/custom_cluster/test_session_expiration.py @@ -15,11 +15,9 @@ # Tests for query expiration. import pytest -import threading +from time import sleep + from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.custom_cluster_test_suite import NUM_SUBSCRIBERS, CLUSTER_SIZE -from time import sleep, time -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException class TestSessionExpiration(CustomClusterTestSuite): """Tests query expiration logic""" http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/custom_cluster/test_spilling.py ---------------------------------------------------------------------- diff --git a/tests/custom_cluster/test_spilling.py b/tests/custom_cluster/test_spilling.py index 2256f0b..4e267ac 100644 --- a/tests/custom_cluster/test_spilling.py +++ b/tests/custom_cluster/test_spilling.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import pytest from copy import deepcopy + from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.test_dimensions import (TestDimension, create_single_exec_option_dimension, http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/data_errors/test_data_errors.py ---------------------------------------------------------------------- diff --git a/tests/data_errors/test_data_errors.py b/tests/data_errors/test_data_errors.py index e7897e4..1e94a54 100644 --- a/tests/data_errors/test_data_errors.py +++ b/tests/data_errors/test_data_errors.py @@ -15,10 +15,10 @@ # # Tests Impala properly handles errors when reading and writing data. +import pytest + from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfLocal -import random -import pytest class TestDataErrors(ImpalaTestSuite): @classmethod http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/experiments/test_process_failures.py ---------------------------------------------------------------------- diff --git a/tests/experiments/test_process_failures.py b/tests/experiments/test_process_failures.py index 4b8ce66..97254cd 100644 --- a/tests/experiments/test_process_failures.py +++ b/tests/experiments/test_process_failures.py @@ -15,9 +15,11 @@ # Impala process failure test suite import pytest -from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.custom_cluster_test_suite import NUM_SUBSCRIBERS, CLUSTER_SIZE -from time import sleep + +from tests.common.custom_cluster_test_suite import ( + NUM_SUBSCRIBERS, + CLUSTER_SIZE, + CustomClusterTestSuite) # The exact query doesn't matter much for these tests, just want a query that touches # data on all nodes. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/experiments/test_targeted_perf.py ---------------------------------------------------------------------- diff --git a/tests/experiments/test_targeted_perf.py b/tests/experiments/test_targeted_perf.py index 886d757..57dd036 100644 --- a/tests/experiments/test_targeted_perf.py +++ b/tests/experiments/test_targeted_perf.py @@ -3,9 +3,7 @@ # These queries are already run as part of our performance benchmarking. # Additionally, we don't get any 'extra' coverage from them, so they're # not an essential part of functional verification. -import logging -import pytest -from tests.common.test_vector import * + from tests.common.impala_test_suite import ImpalaTestSuite class TestTargetedPerf(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/failure/test_failpoints.py ---------------------------------------------------------------------- diff --git a/tests/failure/test_failpoints.py b/tests/failure/test_failpoints.py index 7bcf8cf..acc917a 100644 --- a/tests/failure/test_failpoints.py +++ b/tests/failure/test_failpoints.py @@ -3,17 +3,15 @@ # two types of failures - cancellation of the query and a failure test hook. # import os -import pytest import re -from copy import copy from collections import defaultdict +from time import sleep + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY, LOG -from tests.common.test_vector import TestDimension -from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.impala_test_suite import ImpalaTestSuite, LOG from tests.common.skip import SkipIf, SkipIfS3, SkipIfIsilon, SkipIfLocal -from tests.util.test_file_parser import QueryTestSectionReader -from time import sleep +from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.test_vector import TestDimension FAILPOINT_ACTION = ['FAIL', 'CANCEL'] FAILPOINT_LOCATION = ['PREPARE', 'PREPARE_SCANNER', 'OPEN', 'GETNEXT', 'CLOSE'] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_compute_stats.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_compute_stats.py b/tests/metadata/test_compute_stats.py index efd8c4e..06cd88c 100644 --- a/tests/metadata/test_compute_stats.py +++ b/tests/metadata/test_compute_stats.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest from subprocess import check_call -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.test_dimensions import create_uncompressed_text_dimension -from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIf, SkipIfLocal -from tests.util.filesystem_utils import WAREHOUSE +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.test_dimensions import ( + create_exec_option_dimension, + create_single_exec_option_dimension, + create_uncompressed_text_dimension) # Tests the COMPUTE STATS command for gathering table and column stats. class TestComputeStats(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_ddl.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_ddl.py b/tests/metadata/test_ddl.py index e446b2f..7088ee4 100644 --- a/tests/metadata/test_ddl.py +++ b/tests/metadata/test_ddl.py @@ -11,15 +11,15 @@ # 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. -# + +import getpass import pytest import time -import getpass -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.skip import SkipIf, SkipIfLocal, SkipIfOldAggsJoins -from tests.util.filesystem_utils import WAREHOUSE, IS_LOCAL + from test_ddl_base import TestDdlBase +from tests.common.impala_test_suite import LOG +from tests.common.skip import SkipIf, SkipIfLocal, SkipIfOldAggsJoins +from tests.util.filesystem_utils import WAREHOUSE, IS_LOCAL, IS_S3 # Validates DDL statements (create, drop) class TestDdlStatements(TestDdlBase): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_ddl_base.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_ddl_base.py b/tests/metadata/test_ddl_base.py index 5eee77f..13fd143 100644 --- a/tests/metadata/test_ddl_base.py +++ b/tests/metadata/test_ddl_base.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from tests.common.test_vector import * -from tests.common.test_dimensions import ALL_NODES_ONLY -from tests.common.impala_test_suite import * -from tests.util.filesystem_utils import WAREHOUSE, IS_LOCAL +from tests.common.test_dimensions import ( + ALL_NODES_ONLY, + create_exec_option_dimension, + create_uncompressed_text_dimension) +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.util.filesystem_utils import WAREHOUSE # Base class that most DDL tests inherit from. The tests have a few common functions, # as well as test dimensions and setup/teardown. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_explain.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_explain.py b/tests/metadata/test_explain.py index 0719a21..e1bb7c8 100644 --- a/tests/metadata/test_explain.py +++ b/tests/metadata/test_explain.py @@ -1,12 +1,11 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Functional tests running EXPLAIN statements. # -import logging import pytest import re -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.skip import SkipIfS3, SkipIfLocal + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.skip import SkipIfLocal from tests.util.filesystem_utils import WAREHOUSE # Tests the different explain levels [0-3] on a few queries. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_hdfs_encryption.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_hdfs_encryption.py b/tests/metadata/test_hdfs_encryption.py index 037b4a0..b833a9e 100644 --- a/tests/metadata/test_hdfs_encryption.py +++ b/tests/metadata/test_hdfs_encryption.py @@ -13,12 +13,14 @@ # limitations under the License. import getpass -import logging import pytest -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal -from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.test_dimensions import ( + create_single_exec_option_dimension, + create_uncompressed_text_dimension) +from tests.common.test_vector import TestDimension from tests.util.shell_util import exec_process TEST_DB = 'test_encryption_db' http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_hdfs_permissions.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_hdfs_permissions.py b/tests/metadata/test_hdfs_permissions.py index 75aac50..83b8602 100644 --- a/tests/metadata/test_hdfs_permissions.py +++ b/tests/metadata/test_hdfs_permissions.py @@ -12,13 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -import os -import pytest -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfLocal +from tests.common.test_dimensions import ( + create_single_exec_option_dimension, + create_uncompressed_text_dimension) from tests.util.filesystem_utils import IS_ISILON, WAREHOUSE TEST_TBL = 'read_only_tbl' http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_hidden_files.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_hidden_files.py b/tests/metadata/test_hidden_files.py index 9126208..828cf65 100644 --- a/tests/metadata/test_hidden_files.py +++ b/tests/metadata/test_hidden_files.py @@ -1,9 +1,11 @@ # Copyright (c) 2015 Cloudera, Inc. All rights reserved. -import pytest from subprocess import check_call -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_dimensions import ( + create_single_exec_option_dimension, + create_uncompressed_text_dimension) from tests.util.filesystem_utils import WAREHOUSE, IS_S3 class TestHiddenFiles(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_hms_integration.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_hms_integration.py b/tests/metadata/test_hms_integration.py index 1328e37..bfb324d 100644 --- a/tests/metadata/test_hms_integration.py +++ b/tests/metadata/test_hms_integration.py @@ -25,10 +25,12 @@ import pytest import random import string from subprocess import call -from tests.common.test_result_verifier import * -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.test_dimensions import ( + create_single_exec_option_dimension, + create_uncompressed_text_dimension) @SkipIfS3.hive @SkipIfIsilon.hive http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_last_ddl_time_update.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_last_ddl_time_update.py b/tests/metadata/test_last_ddl_time_update.py index 8de7fe5..f5b2aa1 100644 --- a/tests/metadata/test_last_ddl_time_update.py +++ b/tests/metadata/test_last_ddl_time_update.py @@ -1,9 +1,8 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Impala tests for DDL statements import time -from tests.common.skip import SkipIfS3 -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite from tests.util.filesystem_utils import WAREHOUSE, IS_S3 # Checks that ALTER and INSERT statements update the last DDL time of the modified table. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_load.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_load.py b/tests/metadata/test_load.py index 47703ec..1899012 100644 --- a/tests/metadata/test_load.py +++ b/tests/metadata/test_load.py @@ -1,8 +1,6 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Functional tests for LOAD DATA statements. -import os -import pytest from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.test_dimensions import ( create_single_exec_option_dimension, http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_metadata_query_statements.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_metadata_query_statements.py b/tests/metadata/test_metadata_query_statements.py index f84fbd7..1156b31 100644 --- a/tests/metadata/test_metadata_query_statements.py +++ b/tests/metadata/test_metadata_query_statements.py @@ -1,12 +1,14 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Impala tests for queries that query metadata and set session settings -import logging -import os + import pytest + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfIsilon, SkipIfS3, SkipIfLocal -from tests.common.test_vector import * +from tests.common.test_dimensions import ALL_NODES_ONLY +from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.test_dimensions import create_uncompressed_text_dimension from tests.util.filesystem_utils import get_fs_path # TODO: For these tests to pass, all table metadata must be created exhaustively. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_partition_metadata.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_partition_metadata.py b/tests/metadata/test_partition_metadata.py index d48b09f..8bc32a5 100644 --- a/tests/metadata/test_partition_metadata.py +++ b/tests/metadata/test_partition_metadata.py @@ -12,17 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -import pytest -import shlex -import time -from subprocess import call -from tests.common.test_result_verifier import * -from tests.util.shell_util import exec_process -from tests.common.test_vector import * -from tests.common.test_dimensions import ALL_NODES_ONLY -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.test_dimensions import create_single_exec_option_dimension from tests.util.filesystem_utils import WAREHOUSE # Tests specific to partition metadata. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_recover_partitions.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_recover_partitions.py b/tests/metadata/test_recover_partitions.py index 4997756..4a2670d 100644 --- a/tests/metadata/test_recover_partitions.py +++ b/tests/metadata/test_recover_partitions.py @@ -13,11 +13,14 @@ # limitations under the License. # # Impala tests for ALTER TABLE RECOVER PARTITIONS statement -import pytest -from tests.common.test_dimensions import ALL_NODES_ONLY -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfLocal -from tests.util.filesystem_utils import WAREHOUSE, IS_DEFAULT_FS +from tests.common.test_dimensions import ALL_NODES_ONLY +from tests.common.test_dimensions import create_exec_option_dimension +from tests.util.filesystem_utils import WAREHOUSE + +from tests.common.test_dimensions import create_uncompressed_text_dimension # Validates ALTER TABLE RECOVER PARTITIONS statement http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_set.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_set.py b/tests/metadata/test_set.py index 9b77d2c..71f2516 100644 --- a/tests/metadata/test_set.py +++ b/tests/metadata/test_set.py @@ -14,11 +14,10 @@ # # Tests for SET <query option> -import logging -import pytest -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.test_dimensions import * -from tests.common.impala_test_suite import ImpalaTestSuite, SINGLE_NODE_ONLY +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_dimensions import ( + create_single_exec_option_dimension, + create_uncompressed_text_dimension) class TestSet(ImpalaTestSuite): @classmethod http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_show_create_table.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_show_create_table.py b/tests/metadata/test_show_create_table.py index fdd868d..f17f553 100644 --- a/tests/metadata/test_show_create_table.py +++ b/tests/metadata/test_show_create_table.py @@ -11,14 +11,14 @@ # 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. +import pprint import re import shlex -from subprocess import call -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.skip import SkipIf, SkipIfS3 -from tests.util.filesystem_utils import WAREHOUSE -from tests.util.test_file_parser import remove_comments + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.skip import SkipIf +from tests.common.test_dimensions import create_uncompressed_text_dimension +from tests.util.test_file_parser import QueryTestSectionReader, remove_comments # The purpose of the show create table tests are to ensure that the "SHOW CREATE TABLE" http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_stale_metadata.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_stale_metadata.py b/tests/metadata/test_stale_metadata.py index f3c6db7..84183f0 100644 --- a/tests/metadata/test_stale_metadata.py +++ b/tests/metadata/test_stale_metadata.py @@ -1,11 +1,11 @@ # Copyright (c) 2015 Cloudera, Inc. All rights reserved. -import random from subprocess import check_call + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.impala_test_suite import create_single_exec_option_dimension from tests.common.skip import SkipIfS3 +from tests.common.test_dimensions import create_single_exec_option_dimension from tests.util.filesystem_utils import get_fs_path class TestRewrittenFile(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/metadata/test_views_compatibility.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_views_compatibility.py b/tests/metadata/test_views_compatibility.py index 20c5dd2..fe9540d 100644 --- a/tests/metadata/test_views_compatibility.py +++ b/tests/metadata/test_views_compatibility.py @@ -11,13 +11,17 @@ # 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. + +import pprint +import pytest import shlex from subprocess import call -from tests.common.test_vector import * + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal -from tests.util.filesystem_utils import WAREHOUSE +from tests.common.test_dimensions import create_uncompressed_text_dimension +from tests.util.test_file_parser import QueryTestSectionReader # The purpose of view compatibility testing is to check whether views created in Hive # can be queried in Impala and vice versa. A test typically consists of http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/performance/query_exec_functions.py ---------------------------------------------------------------------- diff --git a/tests/performance/query_exec_functions.py b/tests/performance/query_exec_functions.py index 0b3307b..06fe935 100644 --- a/tests/performance/query_exec_functions.py +++ b/tests/performance/query_exec_functions.py @@ -19,15 +19,7 @@ from datetime import datetime from impala.dbapi import connect from tests.beeswax.impala_beeswax import ImpalaBeeswaxClient, ImpalaBeeswaxResult from sys import maxint -from tests.performance.query import Query, HiveQueryResult, ImpalaQueryResult -from tests.performance.query_executor import ( - QueryExecConfig, - ImpalaQueryExecConfig, - JdbcQueryExecConfig, - BeeswaxQueryExecConfig, - ImpalaHS2QueryConfig, - HiveHS2QueryConfig - ) +from tests.performance.query import HiveQueryResult, ImpalaQueryResult from tests.util.shell_util import exec_process from time import time import threading @@ -98,7 +90,7 @@ def get_hs2_impala_cursor(impalad, use_kerberos=False, database=None): """ try: host, port = impalad.split(":") - except ValueError, v: + except ValueError: host, port = impalad, DEFAULT_HS2_PORT cursor = None try: http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/performance/query_executor.py ---------------------------------------------------------------------- diff --git a/tests/performance/query_executor.py b/tests/performance/query_executor.py index aa7348a..3d2e9c5 100644 --- a/tests/performance/query_executor.py +++ b/tests/performance/query_executor.py @@ -29,9 +29,6 @@ import logging import os -from tests.beeswax.impala_beeswax import ImpalaBeeswaxClient, ImpalaBeeswaxResult -from tests.performance.query import Query, HiveQueryResult, ImpalaQueryResult -from impala.dbapi import connect as connect_to_impala # Setup logging for this module. logging.basicConfig(level=logging.INFO, format='[%(name)s] %(threadName)s: %(message)s') LOG = logging.getLogger('query_executor') http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/performance/scheduler.py ---------------------------------------------------------------------- diff --git a/tests/performance/scheduler.py b/tests/performance/scheduler.py index 33623f1..1b84348 100644 --- a/tests/performance/scheduler.py +++ b/tests/performance/scheduler.py @@ -17,9 +17,8 @@ # vector. It treats a workload an the unit of parallelism. import logging -import os -from collections import defaultdict, deque +from collections import defaultdict from copy import deepcopy from random import shuffle from sys import exit http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/performance/workload.py ---------------------------------------------------------------------- diff --git a/tests/performance/workload.py b/tests/performance/workload.py index 6f734c5..7fbdd25 100644 --- a/tests/performance/workload.py +++ b/tests/performance/workload.py @@ -17,7 +17,6 @@ import os import fnmatch import re -from collections import defaultdict from tests.performance.query import Query from tests.util.test_file_parser import parse_query_test_file http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/performance/workload_runner.py ---------------------------------------------------------------------- diff --git a/tests/performance/workload_runner.py b/tests/performance/workload_runner.py index 9641b5b..2e16a17 100644 --- a/tests/performance/workload_runner.py +++ b/tests/performance/workload_runner.py @@ -13,20 +13,22 @@ # limitations under the License. import logging -from tests.common.test_dimensions import (TableFormatInfo, - load_table_info_dimension, - get_dataset_from_workload) -from tests.performance.query import Query, ImpalaQueryResult, HiveQueryResult -from tests.performance.query_executor import (BeeswaxQueryExecConfig, + +from tests.common.test_dimensions import ( + TableFormatInfo, + get_dataset_from_workload, + load_table_info_dimension) +from tests.performance.query_executor import ( + BeeswaxQueryExecConfig, + HiveHS2QueryConfig, ImpalaHS2QueryConfig, JdbcQueryExecConfig, - HiveHS2QueryConfig, QueryExecutor) from tests.performance.query_exec_functions import ( + execute_using_hive_hs2, execute_using_impala_beeswax, execute_using_impala_hs2, - execute_using_jdbc, - execute_using_hive_hs2) + execute_using_jdbc) from tests.performance.scheduler import Scheduler # Setup Logging http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_aggregation.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_aggregation.py b/tests/query_test/test_aggregation.py index 0d113a7..944c337 100644 --- a/tests/query_test/test_aggregation.py +++ b/tests/query_test/test_aggregation.py @@ -1,14 +1,14 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Validates all aggregate functions across all datatypes # -import logging import pytest -from tests.common.test_vector import * + from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.test_dimensions import create_exec_option_dimension -from tests.common.test_dimensions import create_uncompressed_text_dimension -from tests.common.skip import SkipIfOldAggsJoins, SkipIfS3 -from tests.util.test_file_parser import QueryTestSectionReader +from tests.common.test_dimensions import ( + create_exec_option_dimension, + create_uncompressed_text_dimension) +from tests.common.test_vector import TestDimension +from tests.common.skip import SkipIfOldAggsJoins agg_functions = ['sum', 'count', 'min', 'max', 'avg'] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_analytic_tpcds.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_analytic_tpcds.py b/tests/query_test/test_analytic_tpcds.py index 4b82f7e..7481ba5 100644 --- a/tests/query_test/test_analytic_tpcds.py +++ b/tests/query_test/test_analytic_tpcds.py @@ -14,8 +14,6 @@ # # Targeted tests to validate analytic functions use TPCDS dataset. -import logging -import pytest from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.test_dimensions import create_parquet_dimension, TestDimension http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_avro_schema_resolution.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_avro_schema_resolution.py b/tests/query_test/test_avro_schema_resolution.py index 527181c..3917638 100644 --- a/tests/query_test/test_avro_schema_resolution.py +++ b/tests/query_test/test_avro_schema_resolution.py @@ -1,10 +1,6 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. -import pytest -from subprocess import call -from subprocess import check_call -from tests.common.test_vector import * -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite # This test requires that testdata/avro_schema_resolution/create_table.sql has been run class TestAvroSchemaResolution(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_cancellation.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_cancellation.py b/tests/query_test/test_cancellation.py index 729ed3b..41013d2 100644 --- a/tests/query_test/test_cancellation.py +++ b/tests/query_test/test_cancellation.py @@ -2,7 +2,6 @@ # Tests query cancellation using the ImpalaService.Cancel API # -import os import pytest import threading from random import choice @@ -10,8 +9,6 @@ from time import sleep from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.test_vector import TestDimension from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.skip import SkipIfS3 -from tests.util.test_file_parser import QueryTestSectionReader from tests.verifiers.metric_verifier import MetricVerifier # Queries to execute. Use the TPC-H dataset because tables are large so queries take some http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_chars.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_chars.py b/tests/query_test/test_chars.py index a1bfe58..f9d8e3e 100644 --- a/tests/query_test/test_chars.py +++ b/tests/query_test/test_chars.py @@ -1,13 +1,9 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # -import logging -import os import pytest -from copy import copy -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.skip import SkipIfS3 -from tests.util.filesystem_utils import WAREHOUSE + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_dimensions import create_exec_option_dimension class TestStringQueries(ImpalaTestSuite): @classmethod http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_compressed_formats.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_compressed_formats.py b/tests/query_test/test_compressed_formats.py index c55c9e7..2fdb5ad 100644 --- a/tests/query_test/test_compressed_formats.py +++ b/tests/query_test/test_compressed_formats.py @@ -1,16 +1,16 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. -import os +import math import pytest -import random -import string import struct import subprocess from os.path import join from subprocess import call -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.test_dimensions import create_single_exec_option_dimension +from tests.common.test_vector import TestDimension from tests.util.filesystem_utils import get_fs_path # (file extension, table suffix) pairs http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_decimal_casting.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_decimal_casting.py b/tests/query_test/test_decimal_casting.py index 2762b26..2debe82 100644 --- a/tests/query_test/test_decimal_casting.py +++ b/tests/query_test/test_decimal_casting.py @@ -14,12 +14,11 @@ # # Validates that casting to Decimal works. # -import logging import pytest from decimal import Decimal, getcontext, ROUND_DOWN from metacomm.combinatorics.all_pairs2 import all_pairs2 as all_pairs -from random import shuffle, randint, seed -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException +from random import randint + from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.test_vector import TestDimension, TestMatrix http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_decimal_queries.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_decimal_queries.py b/tests/query_test/test_decimal_queries.py index ea125e9..9dc80bb 100644 --- a/tests/query_test/test_decimal_queries.py +++ b/tests/query_test/test_decimal_queries.py @@ -1,11 +1,10 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted tests for decimal type. -# -import logging -import pytest + from copy import copy -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_vector import TestDimension class TestDecimalQueries(ImpalaTestSuite): BATCH_SIZES = [0, 1] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_delimited_text.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_delimited_text.py b/tests/query_test/test_delimited_text.py index 5dee745..fbe0772 100644 --- a/tests/query_test/test_delimited_text.py +++ b/tests/query_test/test_delimited_text.py @@ -2,11 +2,11 @@ # Targeted Impala tests for different tuple delimiters, field delimiters, # and escape characters. # -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.test_dimensions import create_exec_option_dimension -from tests.common.test_dimensions import create_uncompressed_text_dimension -from tests.common.skip import SkipIfS3 + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_dimensions import ( + create_single_exec_option_dimension, + create_uncompressed_text_dimension) class TestDelimitedText(ImpalaTestSuite): """ http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_exprs.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_exprs.py b/tests/query_test/test_exprs.py index be3447a..cb3ad7f 100644 --- a/tests/query_test/test_exprs.py +++ b/tests/query_test/test_exprs.py @@ -1,11 +1,9 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Validates limit on scan nodes -# -import logging + import pytest -from copy import copy + from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.test_vector import * from tests.common.test_dimensions import create_exec_option_dimension from tests.common.test_dimensions import create_uncompressed_text_dimension from tests.util.test_file_parser import QueryTestSectionReader http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_hash_join_timer.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_hash_join_timer.py b/tests/query_test/test_hash_join_timer.py index 1979759..af26b1f 100644 --- a/tests/query_test/test_hash_join_timer.py +++ b/tests/query_test/test_hash_join_timer.py @@ -2,6 +2,7 @@ import pytest import re + from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.test_vector import TestDimension @@ -94,7 +95,6 @@ class TestHashJoinTimer(ImpalaTestSuite): profile = self.client.get_runtime_profile(handle) check_execsummary_count = 0 check_fragment_count = 0 - async_build = False for line in profile.split("\n"): # Matching for ExecSummary http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_hbase_queries.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_hbase_queries.py b/tests/query_test/test_hbase_queries.py index f608a96..eb4af6b 100644 --- a/tests/query_test/test_hbase_queries.py +++ b/tests/query_test/test_hbase_queries.py @@ -1,10 +1,9 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted Impala HBase Tests -# -import logging + import pytest -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite class TestHBaseQueries(ImpalaTestSuite): @classmethod http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_hdfs_caching.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_hdfs_caching.py b/tests/query_test/test_hdfs_caching.py index e275cbd..20de318 100644 --- a/tests/query_test/test_hdfs_caching.py +++ b/tests/query_test/test_hdfs_caching.py @@ -1,18 +1,15 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Validates limit on scan nodes -# -import logging -import os + import pytest -from copy import copy -from subprocess import check_call, call -from time import time -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.impala_test_suite import * -from tests.common.test_vector import * +import re +import time +from subprocess import check_call + from tests.common.impala_cluster import ImpalaCluster -from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.test_dimensions import create_single_exec_option_dimension from tests.util.filesystem_utils import get_fs_path from tests.util.shell_util import exec_process http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_hdfs_fd_caching.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_hdfs_fd_caching.py b/tests/query_test/test_hdfs_fd_caching.py index dedafff..e2344dc 100644 --- a/tests/query_test/test_hdfs_fd_caching.py +++ b/tests/query_test/test_hdfs_fd_caching.py @@ -13,18 +13,11 @@ # limitations under the License. -import logging -import os import pytest -from copy import copy -from subprocess import call -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.impala_test_suite import * -from tests.common.test_vector import * + from tests.common.impala_cluster import ImpalaCluster -from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3 -from tests.util.shell_util import exec_process @SkipIfS3.caching http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_insert.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_insert.py b/tests/query_test/test_insert.py index b359553..88c7bd2 100644 --- a/tests/query_test/test_insert.py +++ b/tests/query_test/test_insert.py @@ -1,16 +1,20 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted Impala insert tests -# -import logging -import os + import pytest + from testdata.common import widetable -from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.test_dimensions import create_exec_option_dimension -from tests.common.skip import SkipIfS3, SkipIfLocal -from tests.util.filesystem_utils import IS_LOCAL +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.skip import SkipIfLocal +from tests.common.test_dimensions import ( + create_exec_option_dimension, + create_uncompressed_text_dimension) +from tests.common.test_result_verifier import ( + parse_column_types, + parse_column_labels, + QueryTestResult, + parse_result_rows) +from tests.common.test_vector import TestDimension # TODO: Add Gzip back. IMPALA-424 PARQUET_CODECS = ['none', 'snappy'] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_insert_parquet.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_insert_parquet.py b/tests/query_test/test_insert_parquet.py index a3c5f35..df09bab 100644 --- a/tests/query_test/test_insert_parquet.py +++ b/tests/query_test/test_insert_parquet.py @@ -1,15 +1,13 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted Impala insert tests -# -import logging -import os + import pytest -from tests.common.test_vector import * -from tests.common.impala_test_suite import * + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.skip import SkipIfIsilon, SkipIfLocal from tests.common.test_dimensions import create_exec_option_dimension -from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal -from tests.util.filesystem_utils import get_fs_path -from tests.util.filesystem_utils import WAREHOUSE +from tests.common.test_vector import TestDimension +from tests.util.filesystem_utils import get_fs_path, WAREHOUSE # TODO: Add Gzip back. IMPALA-424 PARQUET_CODECS = ['none', 'snappy'] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_insert_permutation.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_insert_permutation.py b/tests/query_test/test_insert_permutation.py index cac7336..553574b 100644 --- a/tests/query_test/test_insert_permutation.py +++ b/tests/query_test/test_insert_permutation.py @@ -1,12 +1,10 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted Impala insert tests -# -import logging -import pytest -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.test_dimensions import create_exec_option_dimension -from tests.common.skip import SkipIfS3 + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.test_dimensions import ( + create_exec_option_dimension, + create_uncompressed_text_dimension) class TestInsertQueriesWithPermutation(ImpalaTestSuite): """ http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_join_queries.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_join_queries.py b/tests/query_test/test_join_queries.py index 2729b31..6bea545 100644 --- a/tests/query_test/test_join_queries.py +++ b/tests/query_test/test_join_queries.py @@ -1,13 +1,17 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted tests for Impala joins # -import logging -import os import pytest from copy import copy -from tests.common.test_vector import * -from tests.common.impala_test_suite import * -from tests.common.skip import SkipIf, SkipIfS3, SkipIfIsilon, SkipIfOldAggsJoins, SkipIfLocal + +from tests.common.impala_test_suite import ImpalaTestSuite +from tests.common.skip import ( + SkipIf, + SkipIfIsilon, + SkipIfLocal, + SkipIfOldAggsJoins, + SkipIfS3) +from tests.common.test_vector import TestDimension class TestJoinQueries(ImpalaTestSuite): BATCH_SIZES = [0, 1] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_kudu.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_kudu.py b/tests/query_test/test_kudu.py index cc478fe..d8c4e99 100644 --- a/tests/query_test/test_kudu.py +++ b/tests/query_test/test_kudu.py @@ -14,11 +14,13 @@ import pytest from copy import copy + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIf from tests.common.test_dimensions import create_uncompressed_text_dimension -from tests.common.test_vector import * +from tests.common.test_vector import TestDimension + @SkipIf.kudu_not_supported class TestKuduOperations(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_limit.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_limit.py b/tests/query_test/test_limit.py index 3964602..207d8e8 100644 --- a/tests/query_test/test_limit.py +++ b/tests/query_test/test_limit.py @@ -1,13 +1,9 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Validates limit on scan nodes -# -import logging -import pytest -from copy import copy + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.test_vector import * -from tests.util.test_file_parser import QueryTestSectionReader +from tests.common.test_vector import TestDimension class TestLimit(ImpalaTestSuite): LIMIT_VALUES = [1, 2, 3, 4, 5, 10, 100, 5000] http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_mem_usage_scaling.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_mem_usage_scaling.py b/tests/query_test/test_mem_usage_scaling.py index f8affff..67870e5 100644 --- a/tests/query_test/test_mem_usage_scaling.py +++ b/tests/query_test/test_mem_usage_scaling.py @@ -13,13 +13,13 @@ # limitations under the License. # import pytest -import sys -import re from copy import copy + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.test_vector import * -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfLocal +from tests.common.test_dimensions import create_single_exec_option_dimension +from tests.common.test_vector import TestDimension class TestQueryMemLimitScaling(ImpalaTestSuite): """Test class to do functional validation of per query memory limits. """ http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_multiple_filesystems.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_multiple_filesystems.py b/tests/query_test/test_multiple_filesystems.py index f6bf727..039b40b 100644 --- a/tests/query_test/test_multiple_filesystems.py +++ b/tests/query_test/test_multiple_filesystems.py @@ -2,12 +2,12 @@ # Validates table stored on the LocalFileSystem. # import pytest -import os from subprocess import check_call, call + from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.test_dimensions import create_single_exec_option_dimension from tests.common.skip import SkipIf -from tests.util.filesystem_utils import get_secondary_fs_path, S3_BUCKET_NAME, ISILON_NAMENODE +from tests.common.test_dimensions import create_single_exec_option_dimension +from tests.util.filesystem_utils import get_secondary_fs_path @SkipIf.no_secondary_fs class TestMultipleFilesystems(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_nested_types.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_nested_types.py b/tests/query_test/test_nested_types.py index 7f36aa7..f186b03 100644 --- a/tests/query_test/test_nested_types.py +++ b/tests/query_test/test_nested_types.py @@ -2,16 +2,14 @@ # Copyright (c) 2015 Cloudera, Inc. All rights reserved. import os +import pytest import random -from subprocess import check_call +from subprocess import call, check_call -import pytest from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.test_vector import * -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfOldAggsJoins, SkipIfIsilon, SkipIfS3, SkipIfLocal from tests.util.filesystem_utils import WAREHOUSE, get_fs_path -from subprocess import call, check_call @SkipIfOldAggsJoins.nested_types class TestNestedTypes(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_partitioning.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_partitioning.py b/tests/query_test/test_partitioning.py index 7e74b60..3b04474 100644 --- a/tests/query_test/test_partitioning.py +++ b/tests/query_test/test_partitioning.py @@ -11,17 +11,14 @@ # 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. -import logging + import pytest -import shlex -import time -from tests.common.test_result_verifier import * from subprocess import call + from tests.beeswax.impala_beeswax import ImpalaBeeswaxException -from tests.common.test_vector import * -from tests.common.test_dimensions import ALL_NODES_ONLY -from tests.common.impala_test_suite import * +from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal +from tests.common.test_dimensions import create_single_exec_option_dimension # Tests to validate HDFS partitioning. class TestPartitioning(ImpalaTestSuite): http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_queries.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_queries.py b/tests/query_test/test_queries.py index f69c9b7..27b14c2 100644 --- a/tests/query_test/test_queries.py +++ b/tests/query_test/test_queries.py @@ -1,15 +1,12 @@ # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # General Impala query tests -# + import copy -import logging -import os import pytest + from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.test_vector import * from tests.common.test_dimensions import create_uncompressed_text_dimension -from tests.common.test_dimensions import create_exec_option_dimension -from tests.common.skip import SkipIfS3 +from tests.common.test_vector import TestVector class TestQueries(ImpalaTestSuite): @classmethod @@ -183,4 +180,3 @@ class TestQueriesParquetTables(ImpalaTestSuite): vector.get_value('exec_option')['disable_outermost_topn'] = 1 vector.get_value('exec_option')['num_nodes'] = 1 self.run_test_case('QueryTest/single-node-large-sorts', vector) -
