From 8425bcc4a43dd2b1cd1b127a557a74f0e433603a Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 23 Sep 2025 13:51:55 -0700 Subject: [PATCH 1/4] Remove run_all_tests from connection test --- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 7 +++++-- cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc | 9 +++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 2dc719fa05ec..cd1a7795503d 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -41,7 +41,8 @@ add_arrow_test(flight_sql_odbc_test tables_test.cc type_info_test.cc # Connection test needs to be put last to resolve segfault issue - connection_test.cc + # -AL- tests should still run without connection_test + # connection_test.cc odbc_test_suite.cc odbc_test_suite.h # Enable Protobuf cleanup after test execution @@ -53,4 +54,6 @@ add_arrow_test(flight_sql_odbc_test ${ODBCINST} ${SQLite3_LIBRARIES} arrow_odbc_spi_impl - odbcabstraction) + odbcabstraction + LABELS + "arrow_flight_sql_odbc") diff --git a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc index 21d4ef4f8b5f..31648327a85e 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc @@ -1023,7 +1023,8 @@ TYPED_TEST(FlightSQLODBCTestBase, TestSQLSetStmtAttrDescriptor) { } // namespace arrow::flight::sql::odbc -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} +// -AL- see if this is removable? +//int main(int argc, char** argv) { +// ::testing::InitGoogleTest(&argc, argv); +// return RUN_ALL_TESTS(); +//} From 7f88acebe34d5b42fb0090abe7121e6697cd6234 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 23 Sep 2025 14:27:07 -0700 Subject: [PATCH 2/4] Fix segfault test issue Move tests over --- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 2 +- cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index cd1a7795503d..43a66ecd97a8 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -42,7 +42,7 @@ add_arrow_test(flight_sql_odbc_test type_info_test.cc # Connection test needs to be put last to resolve segfault issue # -AL- tests should still run without connection_test - # connection_test.cc + connection_test.cc odbc_test_suite.cc odbc_test_suite.h # Enable Protobuf cleanup after test execution diff --git a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc index 31648327a85e..c7117cfb81fc 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc @@ -24,7 +24,6 @@ #include #include -#include "google/protobuf/message_lite.h" #include "gtest/gtest.h" namespace arrow::flight::sql::odbc { @@ -1022,9 +1021,3 @@ TYPED_TEST(FlightSQLODBCTestBase, TestSQLSetStmtAttrDescriptor) { } } // namespace arrow::flight::sql::odbc - -// -AL- see if this is removable? -//int main(int argc, char** argv) { -// ::testing::InitGoogleTest(&argc, argv); -// return RUN_ALL_TESTS(); -//} From 5e764ac931b0e80442da4439491c103349270bc5 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 23 Sep 2025 14:54:09 -0700 Subject: [PATCH 3/4] Remove `RUN_ALL_TESTS` from `arrow_odbc_spi_impl_test` --- cpp/src/arrow/flight/sql/odbc/flight_sql/CMakeLists.txt | 2 +- .../flight/sql/odbc/flight_sql/flight_sql_connection_test.cc | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/flight_sql/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/flight_sql/CMakeLists.txt index 73e80b4570f2..b62b44ac50f3 100644 --- a/cpp/src/arrow/flight/sql/odbc/flight_sql/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/flight_sql/CMakeLists.txt @@ -125,7 +125,7 @@ set_target_properties(arrow_odbc_spi_impl_cli target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # Unit tests -add_arrow_test(arrow_odbc_spi_impl_test +add_arrow_test(odbc_spi_impl_test SOURCES accessors/boolean_array_accessor_test.cc accessors/binary_array_accessor_test.cc diff --git a/cpp/src/arrow/flight/sql/odbc/flight_sql/flight_sql_connection_test.cc b/cpp/src/arrow/flight/sql/odbc/flight_sql/flight_sql_connection_test.cc index a7a0fc10c295..ac05a0bbd039 100644 --- a/cpp/src/arrow/flight/sql/odbc/flight_sql/flight_sql_connection_test.cc +++ b/cpp/src/arrow/flight/sql/odbc/flight_sql/flight_sql_connection_test.cc @@ -206,8 +206,3 @@ TEST(PopulateCallOptionsTest, GenericOptionWithSpaces) { } // namespace flight_sql } // namespace driver - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} From 20e108b4ac76d0456fcad8d0cc4a424a546b18d6 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 23 Sep 2025 15:00:31 -0700 Subject: [PATCH 4/4] remove unneeded label and restore test order --- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 43a66ecd97a8..c024d7678745 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -32,6 +32,7 @@ set(ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS add_arrow_test(flight_sql_odbc_test SOURCES columns_test.cc + connection_test.cc connection_attr_test.cc connection_info_test.cc errors_test.cc @@ -40,9 +41,6 @@ add_arrow_test(flight_sql_odbc_test statement_test.cc tables_test.cc type_info_test.cc - # Connection test needs to be put last to resolve segfault issue - # -AL- tests should still run without connection_test - connection_test.cc odbc_test_suite.cc odbc_test_suite.h # Enable Protobuf cleanup after test execution @@ -54,6 +52,4 @@ add_arrow_test(flight_sql_odbc_test ${ODBCINST} ${SQLite3_LIBRARIES} arrow_odbc_spi_impl - odbcabstraction - LABELS - "arrow_flight_sql_odbc") + odbcabstraction)