Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-15112: [Integration][C++][Java] Implement Flight SQL integration tests #11989

4 changes: 4 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ if(ARROW_GANDIVA)
set(ARROW_WITH_RE2 ON)
endif()

if(ARROW_BUILD_INTEGRATION AND ARROW_FLIGHT)
set(ARROW_FLIGHT_SQL ON)
endif()

if(ARROW_FLIGHT_SQL)
set(ARROW_FLIGHT ON)
endif()
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,12 @@ if(ARROW_FLIGHT_SQL)
add_subdirectory(flight/sql)
endif()

if(ARROW_FLIGHT
AND ARROW_FLIGHT_SQL
AND ARROW_BUILD_INTEGRATION)
add_subdirectory(flight/integration_tests)
endif()

if(ARROW_HIVESERVER2)
add_subdirectory(dbi/hiveserver2)
endif()
Expand Down
16 changes: 0 additions & 16 deletions cpp/src/arrow/flight/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ if(ARROW_TESTING)
OUTPUTS
ARROW_FLIGHT_TESTING_LIBRARIES
SOURCES
test_integration.cc
test_util.cc
DEPENDENCIES
GTest::gtest
Expand Down Expand Up @@ -246,21 +245,6 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
add_dependencies(arrow_flight flight-test-server)
endif()

if(ARROW_BUILD_INTEGRATION)
add_executable(flight-test-integration-server test_integration_server.cc)
target_link_libraries(flight-test-integration-server ${ARROW_FLIGHT_TEST_LINK_LIBS}
${GFLAGS_LIBRARIES} GTest::gtest)

add_executable(flight-test-integration-client test_integration_client.cc)
target_link_libraries(flight-test-integration-client ${ARROW_FLIGHT_TEST_LINK_LIBS}
${GFLAGS_LIBRARIES} GTest::gtest)

add_dependencies(arrow_flight flight-test-integration-client
flight-test-integration-server)
add_dependencies(arrow-integration flight-test-integration-client
flight-test-integration-server)
endif()

if(ARROW_BUILD_BENCHMARKS)
# Perf server for benchmarks
set(PERF_PROTO_GENERATED_FILES "${CMAKE_CURRENT_BINARY_DIR}/perf.pb.cc"
Expand Down
47 changes: 47 additions & 0 deletions cpp/src/arrow/flight/integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

add_custom_target(arrow_flight_integration_tests)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the target necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already there on arrow/flight/CMakeLists.txt before moving to the new directory


if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static")
set(ARROW_FLIGHT_TEST_LINK_LIBS
arrow_flight_static
arrow_flight_testing_static
arrow_flight_sql_static
${ARROW_FLIGHT_STATIC_LINK_LIBS}
${ARROW_TEST_LINK_LIBS})
else()
set(ARROW_FLIGHT_TEST_LINK_LIBS
arrow_flight_shared
arrow_flight_testing_shared
arrow_flight_sql_shared
${ARROW_TEST_LINK_LIBS}
${ARROW_FLIGHT_SQL_TEST_LINK_LIBS})
endif()

add_executable(flight-test-integration-server test_integration_server.cc
test_integration.cc)
target_link_libraries(flight-test-integration-server ${ARROW_FLIGHT_TEST_LINK_LIBS}
${GFLAGS_LIBRARIES} GTest::gtest)

add_executable(flight-test-integration-client test_integration_client.cc
test_integration.cc)
target_link_libraries(flight-test-integration-client ${ARROW_FLIGHT_TEST_LINK_LIBS}
${GFLAGS_LIBRARIES} GTest::gtest)

add_dependencies(arrow-integration flight-test-integration-client
flight-test-integration-server)
Loading