From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 30230469719 for ; Thu, 24 Sep 2020 15:51:52 +0300 (MSK) From: sergeyb@tarantool.org Date: Thu, 24 Sep 2020 15:50:22 +0300 Message-Id: <6c8e16dd9ed20bbfb94929d4c59cd7541b8ed589.1600951585.git.sergeyb@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/2] cmake: move jepsen targets under option WITH_JEPSEN List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, avtikhon@tarantool.org, alexander.turenko@tarantool.org From: Sergey Bronnikov For running Jepsen tests we need to checkout external repository with tests source code on a build stage. This behaviour brokes a Tarantool build under Gentoo. Option WITH_JEPSEN enables targets only when they needed. Closes #5325 --- .travis.mk | 2 +- CMakeLists.txt | 46 +++++++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.travis.mk b/.travis.mk index d8f97ef5c..17523fb86 100644 --- a/.travis.mk +++ b/.travis.mk @@ -293,5 +293,5 @@ test_freebsd: deps_freebsd test_freebsd_no_deps # ################### test_jepsen: deps_debian_jepsen - cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON + cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON -DWITH_JEPSEN=ON make jepsen-single diff --git a/CMakeLists.txt b/CMakeLists.txt index e8850e320..512f50e05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,30 +164,34 @@ add_custom_command(TARGET luacheck COMMENT "Perform static analysis of Lua code" ) -ExternalProject_Add( - jepsen-tests - GIT_REPOSITORY https://github.com/tarantool/jepsen.tarantool - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - TEST_COMMAND "" -) +if (WITH_JEPSEN) + ExternalProject_Add( + jepsen-tests + GIT_REPOSITORY https://github.com/tarantool/jepsen.tarantool + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) -# -# Enable 'make jepsen-*' targets. -# + # + # Enable 'make jepsen-*' targets. + # -add_custom_target(jepsen-single DEPENDS jepsen-tests) -add_custom_command(TARGET jepsen-single - COMMAND ${BASH} ${PROJECT_SOURCE_DIR}/tools/run-jepsen-tests.sh ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} - COMMENT "Running Jepsen tests on a single Tarantool instance" -) + add_custom_target(jepsen-single DEPENDS jepsen-tests) + add_custom_command(TARGET jepsen-single + COMMAND ${BASH} ${PROJECT_SOURCE_DIR}/tools/run-jepsen-tests.sh + ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} + COMMENT "Running Jepsen tests on a single Tarantool instance" + ) -add_custom_target(jepsen-cluster DEPENDS jepsen-tests) -add_custom_command(TARGET jepsen-cluster - COMMAND ${BASH} ${PROJECT_SOURCE_DIR}/tools/run-jepsen-tests.sh ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} 5 - COMMENT "Running Jepsen tests on a cluster with 5 Tarantool instances" -) + add_custom_target(jepsen-cluster DEPENDS jepsen-tests) + add_custom_command(TARGET jepsen-cluster + COMMAND ${BASH} ${PROJECT_SOURCE_DIR}/tools/run-jepsen-tests.sh + ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} 5 + COMMENT "Running Jepsen tests on a cluster with 5 Tarantool instances" + ) +endif() # # Get version -- 2.25.1