IMPALA-5231: skip test_explain_level on non-HDFS systems Some details of the plans change if we're not running against a 3-node minicluster. The point of these tests is to avoid unintended changes to the explain format, so we don't need to run it against all FSes.
Change-Id: I604f83695e956ef6bc85b5d1bc754ccb1378eda1 Reviewed-on: http://gerrit.cloudera.org:8080/6703 Reviewed-by: Matthew Jacobs <[email protected]> Tested-by: Impala Public 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/fb2a7856 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/fb2a7856 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/fb2a7856 Branch: refs/heads/master Commit: fb2a78567a2172a6778da6930aba4ed489d98d72 Parents: 692c6a5 Author: Tim Armstrong <[email protected]> Authored: Thu Apr 20 09:16:41 2017 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Thu Apr 20 22:50:52 2017 +0000 ---------------------------------------------------------------------- tests/common/skip.py | 6 ++++++ tests/metadata/test_explain.py | 14 +++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/fb2a7856/tests/common/skip.py ---------------------------------------------------------------------- diff --git a/tests/common/skip.py b/tests/common/skip.py index d477e5c..232eab5 100644 --- a/tests/common/skip.py +++ b/tests/common/skip.py @@ -28,6 +28,7 @@ from tests.common.environ import IMPALAD_BUILD, USING_OLD_AGGS_JOINS from tests.util.filesystem_utils import ( IS_ISILON, IS_LOCAL, + IS_HDFS, IS_S3, SECONDARY_FILESYSTEM) @@ -113,6 +114,11 @@ class SkipIfLocal: root_path = pytest.mark.skipif(IS_LOCAL, reason="Tests rely on the root directory") +class SkipIfNotHdfsMinicluster: + # These ones are skipped when not running against a local HDFS mini-cluster. + plans = pytest.mark.skipif(not IS_HDFS or pytest.config.option.testing_remote_cluster, + reason="Test assumes plans from local HDFS mini-cluster") + class SkipIfBuildType: not_dev_build = pytest.mark.skipif(not IMPALAD_BUILD.is_dev(), reason="Tests depends on debug build startup option.") http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/fb2a7856/tests/metadata/test_explain.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_explain.py b/tests/metadata/test_explain.py index 3975e38..1ee823f 100644 --- a/tests/metadata/test_explain.py +++ b/tests/metadata/test_explain.py @@ -21,7 +21,7 @@ import pytest import re from tests.common.impala_test_suite import ImpalaTestSuite -from tests.common.skip import SkipIfLocal +from tests.common.skip import SkipIfLocal, SkipIfNotHdfsMinicluster from tests.util.filesystem_utils import WAREHOUSE # Tests the different explain levels [0-3] on a few queries. @@ -46,29 +46,25 @@ class TestExplain(ImpalaTestSuite): v.get_value('exec_option')['disable_codegen'] == False and\ v.get_value('exec_option')['num_nodes'] != 1) - @pytest.mark.skip_if(pytest.config.option.testing_remote_cluster, - reason='Resource profile depends on number of nodes') + @SkipIfNotHdfsMinicluster.plans def test_explain_level0(self, vector): vector.get_value('exec_option')['num_scanner_threads'] = self.NUM_SCANNER_THREADS vector.get_value('exec_option')['explain_level'] = 0 self.run_test_case('QueryTest/explain-level0', vector) - @pytest.mark.skip_if(pytest.config.option.testing_remote_cluster, - reason='Resource profile depends on number of nodes') + @SkipIfNotHdfsMinicluster.plans def test_explain_level1(self, vector): vector.get_value('exec_option')['num_scanner_threads'] = self.NUM_SCANNER_THREADS vector.get_value('exec_option')['explain_level'] = 1 self.run_test_case('QueryTest/explain-level1', vector) - @pytest.mark.skip_if(pytest.config.option.testing_remote_cluster, - reason='Resource profile depends on number of nodes') + @SkipIfNotHdfsMinicluster.plans def test_explain_level2(self, vector): vector.get_value('exec_option')['num_scanner_threads'] = self.NUM_SCANNER_THREADS vector.get_value('exec_option')['explain_level'] = 2 self.run_test_case('QueryTest/explain-level2', vector) - @pytest.mark.skip_if(pytest.config.option.testing_remote_cluster, - reason='Resource profile depends on number of nodes') + @SkipIfNotHdfsMinicluster.plans def test_explain_level3(self, vector): vector.get_value('exec_option')['num_scanner_threads'] = self.NUM_SCANNER_THREADS vector.get_value('exec_option')['explain_level'] = 3
