[Tarantool-patches] [PATCH 1/2] cmake: move jepsen targets under option WITH_JEPSEN

Alexander V. Tikhonov avtikhon at tarantool.org
Fri Sep 25 12:30:34 MSK 2020


Hi Sergey, thanks for the patch. As I see you blocked all the Jepsen
part in cmake targets under the Jepsen's environment variable. And
now only using it the Jepsen's repository will be used. So patch LGTM.

On Thu, Sep 24, 2020 at 03:50:22PM +0300, sergeyb at tarantool.org wrote:
> From: Sergey Bronnikov <sergeyb at tarantool.org>
> 
> 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
> 


More information about the Tarantool-patches mailing list