diff options
author | hcpp <hcpp@ydb.tech> | 2023-08-26 01:25:56 +0300 |
---|---|---|
committer | hcpp <hcpp@ydb.tech> | 2023-08-26 01:46:29 +0300 |
commit | f29dec67a806beef9fbfeac35ddba06adab07109 (patch) | |
tree | 6207b58032f0c88be5dd1247a738a57a67adc70a | |
parent | 62f1d6fbfb81f31ace684ae6d20f4787566e691f (diff) | |
download | ydb-f29dec67a806beef9fbfeac35ddba06adab07109.tar.gz |
folder selection fix
13 files changed, 359 insertions, 1 deletions
diff --git a/ydb/core/fq/libs/compute/common/CMakeLists.darwin-x86_64.txt b/ydb/core/fq/libs/compute/common/CMakeLists.darwin-x86_64.txt index 0d094e80b6..66b32440bf 100644 --- a/ydb/core/fq/libs/compute/common/CMakeLists.darwin-x86_64.txt +++ b/ydb/core/fq/libs/compute/common/CMakeLists.darwin-x86_64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(libs-compute-common) target_compile_options(libs-compute-common PRIVATE diff --git a/ydb/core/fq/libs/compute/common/CMakeLists.linux-aarch64.txt b/ydb/core/fq/libs/compute/common/CMakeLists.linux-aarch64.txt index 7c882266ed..08d7a8e542 100644 --- a/ydb/core/fq/libs/compute/common/CMakeLists.linux-aarch64.txt +++ b/ydb/core/fq/libs/compute/common/CMakeLists.linux-aarch64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(libs-compute-common) target_compile_options(libs-compute-common PRIVATE diff --git a/ydb/core/fq/libs/compute/common/CMakeLists.linux-x86_64.txt b/ydb/core/fq/libs/compute/common/CMakeLists.linux-x86_64.txt index 7c882266ed..08d7a8e542 100644 --- a/ydb/core/fq/libs/compute/common/CMakeLists.linux-x86_64.txt +++ b/ydb/core/fq/libs/compute/common/CMakeLists.linux-x86_64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(libs-compute-common) target_compile_options(libs-compute-common PRIVATE diff --git a/ydb/core/fq/libs/compute/common/CMakeLists.windows-x86_64.txt b/ydb/core/fq/libs/compute/common/CMakeLists.windows-x86_64.txt index 0d094e80b6..66b32440bf 100644 --- a/ydb/core/fq/libs/compute/common/CMakeLists.windows-x86_64.txt +++ b/ydb/core/fq/libs/compute/common/CMakeLists.windows-x86_64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(libs-compute-common) target_compile_options(libs-compute-common PRIVATE diff --git a/ydb/core/fq/libs/compute/common/config.h b/ydb/core/fq/libs/compute/common/config.h index c197e98c71..5beb8bf509 100644 --- a/ydb/core/fq/libs/compute/common/config.h +++ b/ydb/core/fq/libs/compute/common/config.h @@ -43,7 +43,7 @@ public: const auto& excludeScopes = activation.GetExcludeScopes(); auto isActivatedCase1 = activation.GetPercentage() == 0 && - Find(includeScopes, scope) == includeScopes.end(); + Find(includeScopes, scope) != includeScopes.end(); auto isActivatedCase2 = activation.GetPercentage() == 100 && Find(excludeScopes, scope) != excludeScopes.end(); diff --git a/ydb/core/fq/libs/compute/common/ut/CMakeLists.darwin-x86_64.txt b/ydb/core/fq/libs/compute/common/ut/CMakeLists.darwin-x86_64.txt new file mode 100644 index 0000000000..a30dc5b948 --- /dev/null +++ b/ydb/core/fq/libs/compute/common/ut/CMakeLists.darwin-x86_64.txt @@ -0,0 +1,70 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-core-fq-libs-compute-common-ut) +target_compile_options(ydb-core-fq-libs-compute-common-ut PRIVATE + -DUSE_CURRENT_UDF_ABI_VERSION +) +target_include_directories(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common +) +target_link_libraries(ydb-core-fq-libs-compute-common-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + libs-compute-common +) +target_link_options(ydb-core-fq-libs-compute-common-ut PRIVATE + -Wl,-platform_version,macos,11.0,11.0 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common/ut/config_ut.cpp +) +set_property( + TARGET + ydb-core-fq-libs-compute-common-ut + PROPERTY + SPLIT_FACTOR + 10 +) +add_yunittest( + NAME + ydb-core-fq-libs-compute-common-ut + TEST_TARGET + ydb-core-fq-libs-compute-common-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-core-fq-libs-compute-common-ut + system_allocator +) +vcs_info(ydb-core-fq-libs-compute-common-ut) diff --git a/ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-aarch64.txt b/ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..e6806fa64f --- /dev/null +++ b/ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,73 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-core-fq-libs-compute-common-ut) +target_compile_options(ydb-core-fq-libs-compute-common-ut PRIVATE + -DUSE_CURRENT_UDF_ABI_VERSION +) +target_include_directories(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common +) +target_link_libraries(ydb-core-fq-libs-compute-common-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-testing-unittest_main + libs-compute-common +) +target_link_options(ydb-core-fq-libs-compute-common-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common/ut/config_ut.cpp +) +set_property( + TARGET + ydb-core-fq-libs-compute-common-ut + PROPERTY + SPLIT_FACTOR + 10 +) +add_yunittest( + NAME + ydb-core-fq-libs-compute-common-ut + TEST_TARGET + ydb-core-fq-libs-compute-common-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-core-fq-libs-compute-common-ut + cpp-malloc-jemalloc +) +vcs_info(ydb-core-fq-libs-compute-common-ut) diff --git a/ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-x86_64.txt b/ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-x86_64.txt new file mode 100644 index 0000000000..c82ac1da4d --- /dev/null +++ b/ydb/core/fq/libs/compute/common/ut/CMakeLists.linux-x86_64.txt @@ -0,0 +1,75 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-core-fq-libs-compute-common-ut) +target_compile_options(ydb-core-fq-libs-compute-common-ut PRIVATE + -DUSE_CURRENT_UDF_ABI_VERSION +) +target_include_directories(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common +) +target_link_libraries(ydb-core-fq-libs-compute-common-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + libs-compute-common +) +target_link_options(ydb-core-fq-libs-compute-common-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common/ut/config_ut.cpp +) +set_property( + TARGET + ydb-core-fq-libs-compute-common-ut + PROPERTY + SPLIT_FACTOR + 10 +) +add_yunittest( + NAME + ydb-core-fq-libs-compute-common-ut + TEST_TARGET + ydb-core-fq-libs-compute-common-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-core-fq-libs-compute-common-ut + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache +) +vcs_info(ydb-core-fq-libs-compute-common-ut) diff --git a/ydb/core/fq/libs/compute/common/ut/CMakeLists.txt b/ydb/core/fq/libs/compute/common/ut/CMakeLists.txt new file mode 100644 index 0000000000..f8b31df0c1 --- /dev/null +++ b/ydb/core/fq/libs/compute/common/ut/CMakeLists.txt @@ -0,0 +1,17 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-aarch64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + include(CMakeLists.darwin-x86_64.txt) +elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA) + include(CMakeLists.windows-x86_64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-x86_64.txt) +endif() diff --git a/ydb/core/fq/libs/compute/common/ut/CMakeLists.windows-x86_64.txt b/ydb/core/fq/libs/compute/common/ut/CMakeLists.windows-x86_64.txt new file mode 100644 index 0000000000..ac18755572 --- /dev/null +++ b/ydb/core/fq/libs/compute/common/ut/CMakeLists.windows-x86_64.txt @@ -0,0 +1,63 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-core-fq-libs-compute-common-ut) +target_compile_options(ydb-core-fq-libs-compute-common-ut PRIVATE + -DUSE_CURRENT_UDF_ABI_VERSION +) +target_include_directories(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common +) +target_link_libraries(ydb-core-fq-libs-compute-common-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + libs-compute-common +) +target_sources(ydb-core-fq-libs-compute-common-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/fq/libs/compute/common/ut/config_ut.cpp +) +set_property( + TARGET + ydb-core-fq-libs-compute-common-ut + PROPERTY + SPLIT_FACTOR + 10 +) +add_yunittest( + NAME + ydb-core-fq-libs-compute-common-ut + TEST_TARGET + ydb-core-fq-libs-compute-common-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-core-fq-libs-compute-common-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-core-fq-libs-compute-common-ut + system_allocator +) +vcs_info(ydb-core-fq-libs-compute-common-ut) diff --git a/ydb/core/fq/libs/compute/common/ut/config_ut.cpp b/ydb/core/fq/libs/compute/common/ut/config_ut.cpp new file mode 100644 index 0000000000..ea87dcfbe3 --- /dev/null +++ b/ydb/core/fq/libs/compute/common/ut/config_ut.cpp @@ -0,0 +1,37 @@ +#include <ydb/core/fq/libs/compute/common/config.h> + +#include <library/cpp/testing/unittest/tests_data.h> +#include <library/cpp/testing/unittest/registar.h> + +#include <google/protobuf/text_format.h> + +Y_UNIT_TEST_SUITE(Config) { + Y_UNIT_TEST(Test1) { + NFq::NConfig::TComputeConfig proto; + UNIT_ASSERT(google::protobuf::TextFormat::ParseFromString(R"( + DefaultCompute: IN_PLACE + ComputeMapping { + QueryType: ANALYTICS + Compute: YDB + Activation { + IncludeScopes: "oss://test1" + } + } + Ydb { + Enable: true + ControlPlane { + Enable: true + Cms { + } + } + PinTenantName: "/root/cp" + SynchronizationService { + Enable: True + } + } + )", &proto)); + NFq::TComputeConfig config(proto); + UNIT_ASSERT(config.YdbComputeControlPlaneEnabled("oss://test1")); + UNIT_ASSERT(!config.YdbComputeControlPlaneEnabled("oss://test2")); + } +} diff --git a/ydb/core/fq/libs/compute/common/ut/ya.make b/ydb/core/fq/libs/compute/common/ut/ya.make new file mode 100644 index 0000000000..3feb279931 --- /dev/null +++ b/ydb/core/fq/libs/compute/common/ut/ya.make @@ -0,0 +1,15 @@ +UNITTEST_FOR(ydb/core/fq/libs/compute/common) + +FORK_SUBTESTS() + +IF (SANITIZER_TYPE OR WITH_VALGRIND) + SIZE(MEDIUM) +ENDIF() + +SRCS( + config_ut.cpp +) + +YQL_LAST_ABI_VERSION() + +END() diff --git a/ydb/core/fq/libs/compute/common/ya.make b/ydb/core/fq/libs/compute/common/ya.make index 6fcaf0b19c..72d745ba09 100644 --- a/ydb/core/fq/libs/compute/common/ya.make +++ b/ydb/core/fq/libs/compute/common/ya.make @@ -16,3 +16,7 @@ PEERDIR( YQL_LAST_ABI_VERSION() END() + +RECURSE_FOR_TESTS( + ut +) |