You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2022/06/15 00:02:28 UTC

[impala] branch master updated: [tools] Add option to disable Python3 testing

This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a3addc3d [tools] Add option to disable Python3 testing
2a3addc3d is described below

commit 2a3addc3d89f89ba5a7c08de0a8cf689d3007e57
Author: Michael Smith <mi...@cloudera.com>
AuthorDate: Tue Jun 14 10:54:04 2022 -0700

    [tools] Add option to disable Python3 testing
    
    An internal test environment is not yet able to configure python3. Adds
    an environment variable to disable configuring and testing with python3.
    
    Tested manually with
    ```
    make impala_shell_pypi
    impala-py.test tests/shell/test_shell_interactive.py
    rm -rf shell/build
    export DISABLE_PYTHON3_TEST=true
    touch CMakeLists.txt && make impala_shell_pypi
    impala-py.test tests/shell/test_shell_interactive.py
    ```
    
    Change-Id: I00999090eb3732a10e114f368b47036131252474
    Reviewed-on: http://gerrit.cloudera.org:8080/18624
    Reviewed-by: Joe McDonnell <jo...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 CMakeLists.txt      | 7 ++++++-
 tests/shell/util.py | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 346d6687d..a5f19ab27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -467,7 +467,12 @@ add_custom_target(impala_python ALL
   COMMAND "${CMAKE_SOURCE_DIR}/bin/init-impala-python.sh"
 )
 
-add_custom_target(impala_shell_pypi ALL DEPENDS shell_python2_install shell_python3_install)
+if(NOT $ENV{DISABLE_PYTHON3_TEST} EQUAL "")
+  message(STATUS "DISABLE_PYTHON3_TEST is set, disabling Python3 virtualenv and tests")
+  add_custom_target(impala_shell_pypi ALL DEPENDS shell_python2_install)
+else()
+  add_custom_target(impala_shell_pypi ALL DEPENDS shell_python2_install shell_python3_install)
+endif()
 
 add_custom_target(notests_independent_targets DEPENDS
   java cscope tarballs impala_python impala_shell_pypi
diff --git a/tests/shell/util.py b/tests/shell/util.py
index faef13825..f42488c48 100755
--- a/tests/shell/util.py
+++ b/tests/shell/util.py
@@ -324,7 +324,10 @@ def get_dev_impala_shell_executable():
 def create_impala_shell_executable_dimension():
   _, include_pypi = get_dev_impala_shell_executable()
   if include_pypi:
-    return ImpalaTestDimension('impala_shell', 'dev', 'python2', 'python3')
+    if 'DISABLE_PYTHON3_TEST' in os.environ:
+      return ImpalaTestDimension('impala_shell', 'dev', 'python2')
+    else:
+      return ImpalaTestDimension('impala_shell', 'dev', 'python2', 'python3')
   else:
     return ImpalaTestDimension('impala_shell', 'dev')