You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2023/04/28 06:58:41 UTC

[arrow-adbc] branch main updated: ci: make sure cpp_test.sh flags still work for verification (#619)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 205cdf5  ci: make sure cpp_test.sh flags still work for verification (#619)
205cdf5 is described below

commit 205cdf5d87f839cefd0a28aee8d3ee6c5f98d297
Author: David Li <li...@gmail.com>
AuthorDate: Fri Apr 28 15:58:36 2023 +0900

    ci: make sure cpp_test.sh flags still work for verification (#619)
    
    Fixes #618.
---
 c/CMakeLists.txt                          |  3 +++
 c/driver/common/CMakeLists.txt            |  4 ++--
 c/driver/flightsql/CMakeLists.txt         |  5 ++---
 c/driver/postgresql/CMakeLists.txt        |  5 ++---
 c/driver/sqlite/CMakeLists.txt            |  5 ++---
 c/driver_manager/CMakeLists.txt           |  5 ++---
 ci/scripts/cpp_test.sh                    | 20 +++++++++++++++++++-
 ci/scripts/python_wheel_windows_build.bat |  9 ++++++---
 8 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
index b38b3cf..a0df701 100644
--- a/c/CMakeLists.txt
+++ b/c/CMakeLists.txt
@@ -44,3 +44,6 @@ endif()
 if(ADBC_DRIVER_SQLITE)
   add_subdirectory(driver/sqlite)
 endif()
+
+validate_config()
+config_summary_message()
diff --git a/c/driver/common/CMakeLists.txt b/c/driver/common/CMakeLists.txt
index 5eaa307..60516b6 100644
--- a/c/driver/common/CMakeLists.txt
+++ b/c/driver/common/CMakeLists.txt
@@ -24,6 +24,8 @@ if(ADBC_BUILD_TESTS)
   add_test_case(driver_common_test
                 PREFIX
                 adbc
+                EXTRA_LABELS
+                driver-common
                 SOURCES
                 utils_test.cc
                 EXTRA_LINK_LIBS
@@ -32,5 +34,3 @@ if(ADBC_BUILD_TESTS)
   target_compile_features(adbc-driver-common-test PRIVATE cxx_std_17)
   adbc_configure_target(adbc-driver-common-test)
 endif()
-
-validate_config()
diff --git a/c/driver/flightsql/CMakeLists.txt b/c/driver/flightsql/CMakeLists.txt
index 1b13024..28d477e 100644
--- a/c/driver/flightsql/CMakeLists.txt
+++ b/c/driver/flightsql/CMakeLists.txt
@@ -45,6 +45,8 @@ if(ADBC_BUILD_TESTS)
   add_test_case(driver_flightsql_test
                 PREFIX
                 adbc
+                EXTRA_LABELS
+                driver-flightsql
                 SOURCES
                 dremio_flightsql_test.cc
                 sqlite_flightsql_test.cc
@@ -56,6 +58,3 @@ if(ADBC_BUILD_TESTS)
   target_compile_features(adbc-driver-flightsql-test PRIVATE cxx_std_17)
   adbc_configure_target(adbc-driver-flightsql-test)
 endif()
-
-validate_config()
-config_summary_message()
diff --git a/c/driver/postgresql/CMakeLists.txt b/c/driver/postgresql/CMakeLists.txt
index 6165f0f..23d5cf9 100644
--- a/c/driver/postgresql/CMakeLists.txt
+++ b/c/driver/postgresql/CMakeLists.txt
@@ -66,6 +66,8 @@ if(ADBC_BUILD_TESTS)
   add_test_case(driver_postgresql_test
                 PREFIX
                 adbc
+                EXTRA_LABELS
+                driver-postgresql
                 SOURCES
                 postgres_type_test.cc
                 postgresql_test.cc
@@ -77,6 +79,3 @@ if(ADBC_BUILD_TESTS)
   target_compile_features(adbc-driver-postgresql-test PRIVATE cxx_std_17)
   adbc_configure_target(adbc-driver-postgresql-test)
 endif()
-
-validate_config()
-config_summary_message()
diff --git a/c/driver/sqlite/CMakeLists.txt b/c/driver/sqlite/CMakeLists.txt
index f5ee32c..9d1d400 100644
--- a/c/driver/sqlite/CMakeLists.txt
+++ b/c/driver/sqlite/CMakeLists.txt
@@ -66,6 +66,8 @@ if(ADBC_BUILD_TESTS)
   add_test_case(driver_sqlite_test
                 PREFIX
                 adbc
+                EXTRA_LABELS
+                driver-sqlite
                 SOURCES
                 sqlite_test.cc
                 ../../validation/adbc_validation.cc
@@ -77,6 +79,3 @@ if(ADBC_BUILD_TESTS)
   target_compile_features(adbc-driver-sqlite-test PRIVATE cxx_std_17)
   adbc_configure_target(adbc-driver-sqlite-test)
 endif()
-
-validate_config()
-config_summary_message()
diff --git a/c/driver_manager/CMakeLists.txt b/c/driver_manager/CMakeLists.txt
index bdeb69d..e062b11 100644
--- a/c/driver_manager/CMakeLists.txt
+++ b/c/driver_manager/CMakeLists.txt
@@ -51,6 +51,8 @@ if(ADBC_BUILD_TESTS)
   add_test_case(driver_manager_test
                 PREFIX
                 adbc
+                EXTRA_LABELS
+                driver-manager
                 SOURCES
                 adbc_driver_manager_test.cc
                 ../validation/adbc_validation.cc
@@ -62,6 +64,3 @@ if(ADBC_BUILD_TESTS)
   target_include_directories(adbc-driver-manager-test SYSTEM
                              PRIVATE ${REPOSITORY_ROOT}/c/vendor/nanoarrow/)
 endif()
-
-validate_config()
-config_summary_message()
diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh
index c385315..1b169cf 100755
--- a/ci/scripts/cpp_test.sh
+++ b/ci/scripts/cpp_test.sh
@@ -29,7 +29,24 @@ test_subproject() {
 
     pushd "${build_dir}/"
 
-    ctest --output-on-failure --no-tests=error
+    local labels="driver-common"
+    if [[ "${BUILD_DRIVER_FLIGHTSQL}" -gt 0 ]]; then
+       labels="${labels}|driver-flightsql"
+    fi
+    if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
+       labels="${labels}|driver-manager"
+    fi
+    if [[ "${BUILD_DRIVER_POSTGRESQL}" -gt 0 ]]; then
+       labels="${labels}|driver-postgresql"
+    fi
+    if [[ "${BUILD_DRIVER_SQLITE}" -gt 0 ]]; then
+       labels="${labels}|driver-sqlite"
+    fi
+
+    ctest \
+        --output-on-failure \
+        --no-tests=error \
+        -L "${labels}"
 
     popd
 }
@@ -45,6 +62,7 @@ main() {
 
     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib"
     export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib"
+    export GODEBUG=cgocheck=2
 
     test_subproject "${build_dir}"
 }
diff --git a/ci/scripts/python_wheel_windows_build.bat b/ci/scripts/python_wheel_windows_build.bat
index 40c093f..3d76ad9 100644
--- a/ci/scripts/python_wheel_windows_build.bat
+++ b/ci/scripts/python_wheel_windows_build.bat
@@ -31,12 +31,14 @@ set VCPKG_TARGET_TRIPLET=x64-windows-static
 IF NOT DEFINED VCPKG_ROOT (echo "Must set VCPKG_ROOT" && exit /B 1)
 
 %VCPKG_ROOT%\vcpkg install --triplet=%VCPKG_TARGET_TRIPLET% libpq sqlite3
+IF %errorlevel% NEQ 0 EXIT /B %errorlevel%
 
 set ADBC_FLIGHTSQL_LIBRARY=%build_dir%\flightsql\adbc_driver_flightsql.dll
 
 mkdir %build_dir%
 pushd %source_dir%\go\adbc\pkg
 go build -tags driverlib -o %ADBC_FLIGHTSQL_LIBRARY% -buildmode=c-shared ./flightsql
+IF %errorlevel% NEQ 0 EXIT /B %errorlevel%
 popd
 
 pushd %build_dir%
@@ -55,6 +57,7 @@ cmake ^
       -DADBC_DRIVER_FLIGHTSQL=ON ^
       -DADBC_DRIVER_MANAGER=ON ^
       %source_dir%\c || exit /B 1
+
 cmake --build . --config %CMAKE_BUILD_TYPE% --target install --verbose -j || exit /B 1
 
 @REM XXX: CMake installs it to bin instead of lib for some reason
@@ -65,7 +68,7 @@ set ADBC_SQLITE_LIBRARY=%build_dir%\bin\adbc_driver_sqlite.dll
 
 popd
 
-python -m pip install --upgrade pip delvewheel wheel
+python -m pip install --upgrade pip delvewheel wheel || exit /B 1
 
 FOR /F %%i IN ('python -c "import sysconfig; print(sysconfig.get_platform())"') DO set PLAT_NAME=%%i
 
@@ -73,7 +76,7 @@ FOR %%c IN (adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adb
     pushd %source_dir%\python\%%c
 
     echo "=== (%PYTHON_VERSION%) Checking %%c version ==="
-    python %%c\_version.py
+    python %%c\_version.py || exit /B 1
 
     echo "=== (%PYTHON_VERSION%) Building %%c wheel ==="
     python -m pip wheel --no-deps -w dist -vvv . || exit /B 1
@@ -85,7 +88,7 @@ FOR %%c IN (adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adb
 
     echo "=== (%PYTHON_VERSION%) Repair %%c wheel ==="
     FOR %%w IN (dist\*.whl) DO (
-        delvewheel repair -w repaired_wheels\ %%w
+        delvewheel repair -w repaired_wheels\ %%w || exit /B 1
     )
 
     popd