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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4f7ba41  Activated tests for `src/python/lib`.
4f7ba41 is described below

commit 4f7ba4101375ac8c8b2cbd1e855ceea72f03d58b
Author: Benjamin Bannier <bbann...@apache.org>
AuthorDate: Mon Sep 9 17:47:56 2019 +0200

    Activated tests for `src/python/lib`.
    
    This directory already had a tox config, but this setup was never
    excercised automatically. This patch adds a test running `tox` for that
    directory. We require `tox` to be present in the system and add
    configure-time checks for that.
    
    Review: https://reviews.apache.org/r/71457/
---
 cmake/CompilationConfigure.cmake | 6 ++++++
 configure.ac                     | 6 ++++++
 src/CMakeLists.txt               | 1 +
 src/Makefile.am                  | 2 ++
 src/python/lib/CMakeLists.txt    | 5 +++++
 5 files changed, 20 insertions(+)

diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index c8da089..62cb23e 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -181,6 +181,12 @@ if (ENABLE_NEW_CLI)
     endif ()
   endif ()
 
+  # Find `tox` for testing `src/python/lib/`.
+  find_program(TOX tox)
+  if (NOT TOX)
+    message(FATAL_ERROR "'tox' is required in order to run Mesos Python 
library tests.")
+  endif ()
+
   execute_process(
     COMMAND ${PYTHON_3} -c
       "import sys; print('%d.%d' % (sys.version_info[0], sys.version_info[1]))"
diff --git a/configure.ac b/configure.ac
index 1814bc6..f274f34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2499,6 +2499,12 @@ You may wish to set the PYTHON_3 environment variable to 
make sure
 that the right Python executable is found.
 -------------------------------------------------------------------
   ])])
+
+  # Find `tox` for testing `src/python/lib/`.
+  AC_CHECK_PROGS([tox], [tox])
+  if test "x$tox" = "x"; then
+    AC_MSG_ERROR(['tox' is required in order to run Mesos Python library 
tests.])
+  fi
 fi
 
 if test "x$enable_python" = "xyes"; then
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0ec4442..ef9382d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -656,6 +656,7 @@ add_subdirectory(log)
 add_subdirectory(master)
 add_subdirectory(python/cli_new)
 add_subdirectory(python/executor)
+add_subdirectory(python/lib)
 add_subdirectory(python/scheduler)
 add_subdirectory(slave)
 add_subdirectory(slave/containerizer/mesos)
diff --git a/src/Makefile.am b/src/Makefile.am
index 5daee63..79bf77d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2938,6 +2938,8 @@ if ENABLE_NEW_CLI
        source $(builddir)/.virtualenv/bin/activate;            \
        source $(builddir)/.virtualenv/bin/postactivate;        \
        PATH=$(builddir):$$PATH mesos-cli-tests
+
+       tox -c $(srcdir)/python/lib/tox.ini
 endif
 
 if INSTALL_TESTS
diff --git a/src/python/lib/CMakeLists.txt b/src/python/lib/CMakeLists.txt
new file mode 100644
index 0000000..118b209
--- /dev/null
+++ b/src/python/lib/CMakeLists.txt
@@ -0,0 +1,5 @@
+if (ENABLE_NEW_CLI)
+  add_test(
+    NAME PythonLibTests
+    COMMAND ${TOX} -c ${CMAKE_CURRENT_SOURCE_DIR}/tox.ini)
+endif ()

Reply via email to