aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfedor-miron <fedor-miron@yandex-team.com>2023-09-07 18:02:18 +0300
committerfedor-miron <fedor-miron@yandex-team.com>2023-09-07 18:36:11 +0300
commitdd4c28b2f5866d767765dcc6fe169c46c801ec47 (patch)
tree74934b0f1dd09e3479cdea6c08d7a0ff4e46a013
parentc15d4e831dbd20e89ff104be83c616d41836e25b (diff)
downloadydb-dd4c28b2f5866d767765dcc6fe169c46c801ec47.tar.gz
gtest to unittest for yt/native/ut
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.darwin-x86_64.txt24
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-aarch64.txt24
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-x86_64.txt24
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.windows-x86_64.txt24
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/ut/ya.make2
-rw-r--r--ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp13
6 files changed, 81 insertions, 30 deletions
diff --git a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.darwin-x86_64.txt b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.darwin-x86_64.txt
index b00ec7398c..f82906144b 100644
--- a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.darwin-x86_64.txt
+++ b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.darwin-x86_64.txt
@@ -15,8 +15,7 @@ target_link_libraries(ydb-library-yql-providers-yt-gateway-native-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
- cpp-testing-gtest
- cpp-testing-gtest_main
+ cpp-testing-unittest_main
yt-gateway-native
yt-gateway-file
yql-core-ut_common
@@ -35,20 +34,33 @@ target_link_options(ydb-library-yql-providers-yt-gateway-native-ut PRIVATE
target_sources(ydb-library-yql-providers-yt-gateway-native-ut PRIVATE
${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp
)
-add_test(
+set_property(
+ TARGET
+ ydb-library-yql-providers-yt-gateway-native-ut
+ PROPERTY
+ SPLIT_FACTOR
+ 1
+)
+add_yunittest(
NAME
ydb-library-yql-providers-yt-gateway-native-ut
- COMMAND
+ TEST_TARGET
ydb-library-yql-providers-yt-gateway-native-ut
+ TEST_ARG
+ --print-before-suite
+ --print-before-test
+ --fork-tests
+ --print-times
+ --show-fails
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
LABELS
SMALL
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
diff --git a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-aarch64.txt b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-aarch64.txt
index b209ede94d..db240f6fe4 100644
--- a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-aarch64.txt
+++ b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-aarch64.txt
@@ -15,8 +15,7 @@ target_link_libraries(ydb-library-yql-providers-yt-gateway-native-ut PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp
yutil
- cpp-testing-gtest
- cpp-testing-gtest_main
+ cpp-testing-unittest_main
yt-gateway-native
yt-gateway-file
yql-core-ut_common
@@ -39,20 +38,33 @@ target_link_options(ydb-library-yql-providers-yt-gateway-native-ut PRIVATE
target_sources(ydb-library-yql-providers-yt-gateway-native-ut PRIVATE
${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp
)
-add_test(
+set_property(
+ TARGET
+ ydb-library-yql-providers-yt-gateway-native-ut
+ PROPERTY
+ SPLIT_FACTOR
+ 1
+)
+add_yunittest(
NAME
ydb-library-yql-providers-yt-gateway-native-ut
- COMMAND
+ TEST_TARGET
ydb-library-yql-providers-yt-gateway-native-ut
+ TEST_ARG
+ --print-before-suite
+ --print-before-test
+ --fork-tests
+ --print-times
+ --show-fails
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
LABELS
SMALL
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
diff --git a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-x86_64.txt b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-x86_64.txt
index 94d201649c..706267e539 100644
--- a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-x86_64.txt
+++ b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.linux-x86_64.txt
@@ -16,8 +16,7 @@ target_link_libraries(ydb-library-yql-providers-yt-gateway-native-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
- cpp-testing-gtest
- cpp-testing-gtest_main
+ cpp-testing-unittest_main
yt-gateway-native
yt-gateway-file
yql-core-ut_common
@@ -40,20 +39,33 @@ target_link_options(ydb-library-yql-providers-yt-gateway-native-ut PRIVATE
target_sources(ydb-library-yql-providers-yt-gateway-native-ut PRIVATE
${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp
)
-add_test(
+set_property(
+ TARGET
+ ydb-library-yql-providers-yt-gateway-native-ut
+ PROPERTY
+ SPLIT_FACTOR
+ 1
+)
+add_yunittest(
NAME
ydb-library-yql-providers-yt-gateway-native-ut
- COMMAND
+ TEST_TARGET
ydb-library-yql-providers-yt-gateway-native-ut
+ TEST_ARG
+ --print-before-suite
+ --print-before-test
+ --fork-tests
+ --print-times
+ --show-fails
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
LABELS
SMALL
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
diff --git a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.windows-x86_64.txt b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.windows-x86_64.txt
index b6ba65dd2a..ca24288198 100644
--- a/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.windows-x86_64.txt
+++ b/ydb/library/yql/providers/yt/gateway/native/ut/CMakeLists.windows-x86_64.txt
@@ -15,8 +15,7 @@ target_link_libraries(ydb-library-yql-providers-yt-gateway-native-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
- cpp-testing-gtest
- cpp-testing-gtest_main
+ cpp-testing-unittest_main
yt-gateway-native
yt-gateway-file
yql-core-ut_common
@@ -28,20 +27,33 @@ target_link_libraries(ydb-library-yql-providers-yt-gateway-native-ut PUBLIC
target_sources(ydb-library-yql-providers-yt-gateway-native-ut PRIVATE
${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp
)
-add_test(
+set_property(
+ TARGET
+ ydb-library-yql-providers-yt-gateway-native-ut
+ PROPERTY
+ SPLIT_FACTOR
+ 1
+)
+add_yunittest(
NAME
ydb-library-yql-providers-yt-gateway-native-ut
- COMMAND
+ TEST_TARGET
ydb-library-yql-providers-yt-gateway-native-ut
+ TEST_ARG
+ --print-before-suite
+ --print-before-test
+ --fork-tests
+ --print-times
+ --show-fails
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
LABELS
SMALL
)
-set_property(
+set_yunittest_property(
TEST
ydb-library-yql-providers-yt-gateway-native-ut
PROPERTY
diff --git a/ydb/library/yql/providers/yt/gateway/native/ut/ya.make b/ydb/library/yql/providers/yt/gateway/native/ut/ya.make
index 42f056a7f3..11f5479d94 100644
--- a/ydb/library/yql/providers/yt/gateway/native/ut/ya.make
+++ b/ydb/library/yql/providers/yt/gateway/native/ut/ya.make
@@ -1,4 +1,4 @@
-GTEST()
+UNITTEST()
SRCS(
yql_yt_native_folders_ut.cpp
diff --git a/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp b/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp
index d83173e2d4..3d2a54f58b 100644
--- a/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp
+++ b/ydb/library/yql/providers/yt/gateway/native/ut/yql_yt_native_folders_ut.cpp
@@ -1,8 +1,8 @@
+#include "library/cpp/testing/unittest/registar.h"
#include <library/cpp/yson/node/node_io.h>
#include <ydb/library/yql/core/ut_common/yql_ut_common.h>
#include <library/cpp/testing/common/network.h>
#include <library/cpp/testing/mock_server/server.h>
-#include <library/cpp/testing/gtest/gtest.h>
#include <ydb/library/yql/providers/yt/gateway/native/yql_yt_native.h>
#include <ydb/library/yql/core/file_storage/proto/file_storage.pb.h>
#include <ydb/library/yql/providers/common/proto/gateways_config.pb.h>
@@ -103,7 +103,7 @@ private:
for (const auto& attribute : attributes.AsList()) {
attributesSet.insert(attribute.AsString());
}
- EXPECT_EQ(requiredAttributes[path], attributesSet);
+ UNIT_ASSERT_VALUES_EQUAL(requiredAttributes[path], attributesSet);
}
THttpResponse HandleListCommand(const NYT::TNode& path, const NYT::TNode& attributes) {
@@ -155,7 +155,9 @@ private:
THashMap<TString, THashSet<TString>> requiredAttributes;
};
-TEST(YtNativeGateway, GetFolder) {
+Y_UNIT_TEST_SUITE(YtNativeGateway) {
+
+Y_UNIT_TEST(GetFolder) {
const auto port = NTesting::GetFreePort();
THashMap<TString, THashSet<TString>> requiredAttributes {
{"//test/a", {"type", "broken", "target_path", "user_attributes"}},
@@ -185,11 +187,12 @@ TEST(YtNativeGateway, GetFolder) {
folderFuture.Wait();
ytState->Gateway->CloseSession({ytState->SessionId});
auto folderRes = folderFuture.GetValue();
- ASSERT_EQ(folderRes.Success(), true) << folderRes.Issues().ToString();
- ASSERT_EQ(
+ UNIT_ASSERT_EQUAL_C(folderRes.Success(), true, folderRes.Issues().ToString());
+ UNIT_ASSERT_EQUAL(
folderRes.ItemsOrFileLink,
(std::variant<TVector<IYtGateway::TFolderResult::TFolderItem>, TFileLinkPtr>(EXPECTED_ITEMS)));
}
+}
} // namespace