2022-07-23 23:15:54 +00:00
|
|
|
set (TEST_USE_BINARIES CLICKHOUSE_TESTS_SERVER_BIN_PATH=${ClickHouse_BINARY_DIR}/programs/clickhouse CLICKHOUSE_TESTS_CLIENT_BIN_PATH=${ClickHouse_BINARY_DIR}/programs/clickhouse)
|
2018-09-21 10:46:58 +00:00
|
|
|
|
2019-04-01 14:58:04 +00:00
|
|
|
find_program(DOCKER_CMD docker)
|
|
|
|
find_program(DOCKER_COMPOSE_CMD docker-compose)
|
|
|
|
find_program(PYTEST_CMD pytest)
|
|
|
|
find_program(SUDO_CMD sudo)
|
|
|
|
|
2018-09-28 14:53:20 +00:00
|
|
|
# will mount only one binary to docker container - build with .so cant work
|
2023-01-03 18:51:10 +00:00
|
|
|
if(DOCKER_CMD)
|
2019-04-01 14:58:04 +00:00
|
|
|
if(INTEGRATION_USE_RUNNER AND SUDO_CMD)
|
2020-04-01 23:51:21 +00:00
|
|
|
add_test(NAME integration-runner WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${SUDO_CMD} ${CMAKE_CURRENT_SOURCE_DIR}/runner --binary ${ClickHouse_BINARY_DIR}/programs/clickhouse --configs-dir ${ClickHouse_SOURCE_DIR}/programs/server/)
|
2019-04-01 14:58:04 +00:00
|
|
|
message(STATUS "Using tests in docker with runner SUDO=${SUDO_CMD}; DOCKER=${DOCKER_CMD};")
|
|
|
|
endif()
|
|
|
|
if(NOT INTEGRATION_USE_RUNNER AND DOCKER_COMPOSE_CMD AND PYTEST_CMD)
|
|
|
|
# To run one test with debug:
|
|
|
|
# cmake . -DPYTEST_OPT="-ss;test_cluster_copier"
|
2020-08-12 08:55:04 +00:00
|
|
|
add_test(NAME integration-pytest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND env ${TEST_USE_BINARIES} "CLICKHOUSE_TESTS_BASE_CONFIG_DIR=${ClickHouse_SOURCE_DIR}/programs/server/" "CLICKHOUSE_TESTS_CONFIG_DIR=${ClickHouse_SOURCE_DIR}/tests/config/" ${PYTEST_STARTER} ${PYTEST_CMD} ${PYTEST_OPT})
|
2019-04-01 14:58:04 +00:00
|
|
|
message(STATUS "Using tests in docker DOCKER=${DOCKER_CMD}; DOCKER_COMPOSE=${DOCKER_COMPOSE_CMD}; PYTEST=${PYTEST_STARTER} ${PYTEST_CMD} ${PYTEST_OPT}")
|
|
|
|
endif()
|
2018-09-28 14:53:20 +00:00
|
|
|
endif()
|