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 47775a8 refactor(c): Simplify CI testing for cpp (#610)
47775a8 is described below
commit 47775a82caf49b9c7a706717f4204cd98b5efcf8
Author: William Ayd <[email protected]>
AuthorDate: Mon May 15 08:10:36 2023 -0700
refactor(c): Simplify CI testing for cpp (#610)
The current test scripts look to be copy/paste from the build scripts. I
think there's some unnecessary stuff there that can be removed, but
figured it might be easier just to remove altogether to reduce layers
---
.github/workflows/integration.yml | 6 +++---
.github/workflows/native-unix.yml | 5 ++---
.github/workflows/native-windows.yml | 4 ++--
ci/scripts/cpp_test.ps1 | 9 ++++-----
ci/scripts/cpp_test.sh | 9 ++++-----
dev/release/verify-release-candidate.ps1 | 2 +-
dev/release/verify-release-candidate.sh | 2 +-
7 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/integration.yml
b/.github/workflows/integration.yml
index e0b1efe..e9cd665 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -108,7 +108,7 @@ jobs:
ADBC_SQLITE_FLIGHTSQL_URI: "grpc+tcp://localhost:8080"
run: |
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+ ./ci/scripts/cpp_test.sh "$(pwd)/build"
- name: Build Python Flight SQL driver
shell: bash -l {0}
env:
@@ -191,7 +191,7 @@ jobs:
BUILD_DRIVER_POSTGRESQL: "1"
ADBC_POSTGRESQL_TEST_URI:
"postgres://localhost:5432/postgres?user=postgres&password=password"
run: |
- ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+ ./ci/scripts/cpp_test.sh "$(pwd)/build"
- name: Build Python PostgreSQL Driver
shell: bash -l {0}
@@ -253,7 +253,7 @@ jobs:
ADBC_SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
run: |
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+ ./ci/scripts/cpp_test.sh "$(pwd)/build"
- name: Build and Test Snowflake Driver (Python)
shell: bash -l {0}
env:
diff --git a/.github/workflows/native-unix.yml
b/.github/workflows/native-unix.yml
index 57b9dca..261ddb5 100644
--- a/.github/workflows/native-unix.yml
+++ b/.github/workflows/native-unix.yml
@@ -174,7 +174,7 @@ jobs:
- name: Test SQLite3 Driver
shell: bash -l {0}
run: |
- env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_test.sh
"$(pwd)" "$(pwd)/build"
+ env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_test.sh
"$(pwd)/build"
- name: Build PostgreSQL Driver
shell: bash -l {0}
run: |
@@ -186,8 +186,7 @@ jobs:
- name: Test Driver Manager
shell: bash -l {0}
run: |
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_build.sh
"$(pwd)" "$(pwd)/build"
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_test.sh
"$(pwd)" "$(pwd)/build"
+ ./ci/scripts/cpp_test.sh "$(pwd)/build"
# ------------------------------------------------------------
# GLib/Ruby
diff --git a/.github/workflows/native-windows.yml
b/.github/workflows/native-windows.yml
index 3537fc4..b94a5c2 100644
--- a/.github/workflows/native-windows.yml
+++ b/.github/workflows/native-windows.yml
@@ -173,14 +173,14 @@ jobs:
BUILD_ALL: "0"
BUILD_DRIVER_MANAGER: "1"
run:
- .\ci\scripts\cpp_test.ps1 $pwd $pwd\build
+ .\ci\scripts\cpp_test.ps1 $pwd\build
- name: Test Driver SQLite
shell: pwsh
env:
BUILD_ALL: "0"
BUILD_DRIVER_SQLITE: "1"
run:
- .\ci\scripts\cpp_test.ps1 $pwd $pwd\build
+ .\ci\scripts\cpp_test.ps1 $pwd\build
# ------------------------------------------------------------
# Go build
diff --git a/ci/scripts/cpp_test.ps1 b/ci/scripts/cpp_test.ps1
index 7380588..0eef6a8 100755
--- a/ci/scripts/cpp_test.ps1
+++ b/ci/scripts/cpp_test.ps1
@@ -18,9 +18,8 @@
$ErrorActionPreference = "Stop"
-$SourceDir = $Args[0]
-$BuildDir = $Args[1]
-$InstallDir = if ($Args[2] -ne $null) { $Args[2] } else { Join-Path $BuildDir
"local/" }
+$BuildDir = $Args[0]
+$InstallDir = if ($Args[1] -ne $null) { $Args[1] } else { Join-Path $BuildDir
"local/" }
$BuildAll = $env:BUILD_ALL -ne "0"
$BuildDriverManager = ($BuildAll -and (-not ($env:BUILD_DRIVER_MANAGER -eq
"0"))) -or ($env:BUILD_DRIVER_MANAGER -eq "1")
@@ -36,7 +35,7 @@ $env:PATH += ";$($InstallDir)"
$env:PATH += ";$($InstallDir)\bin"
$env:PATH += ";$($InstallDir)\lib"
-function Build-Subproject {
+function Test-Project {
Push-Location $BuildDir
$labels = "driver-common"
@@ -63,4 +62,4 @@ function Build-Subproject {
Pop-Location
}
-Build-Subproject
+Test-Project
diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh
index ee73d9c..003ba46 100755
--- a/ci/scripts/cpp_test.sh
+++ b/ci/scripts/cpp_test.sh
@@ -25,7 +25,7 @@ set -e
: ${BUILD_DRIVER_FLIGHTSQL:=${BUILD_ALL}}
: ${BUILD_DRIVER_SNOWFLAKE:=${BUILD_ALL}}
-test_subproject() {
+test_project() {
local -r build_dir="${1}"
pushd "${build_dir}/"
@@ -56,9 +56,8 @@ test_subproject() {
}
main() {
- local -r source_dir="${1}"
- local -r build_dir="${2}"
- local install_dir="${3}"
+ local -r build_dir="${1}"
+ local install_dir="${2}"
if [[ -z "${install_dir}" ]]; then
install_dir="${build_dir}/local"
@@ -68,7 +67,7 @@ main() {
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib"
export GODEBUG=cgocheck=2
- test_subproject "${build_dir}"
+ test_project "${build_dir}"
}
main "$@"
diff --git a/dev/release/verify-release-candidate.ps1
b/dev/release/verify-release-candidate.ps1
index 6be5f09..fcf4cc4 100755
--- a/dev/release/verify-release-candidate.ps1
+++ b/dev/release/verify-release-candidate.ps1
@@ -141,7 +141,7 @@ $env:BUILD_DRIVER_SNOWFLAKE = "0"
if (-not $?) { exit 1 }
$env:BUILD_DRIVER_POSTGRESQL = "0"
-& $(Join-Path $ArrowSourceDir ci\scripts\cpp_test.ps1) $ArrowSourceDir
$CppBuildDir
+& $(Join-Path $ArrowSourceDir ci\scripts\cpp_test.ps1) $CppBuildDir
if (-not $?) { exit 1 }
$env:BUILD_DRIVER_POSTGRESQL = "1"
diff --git a/dev/release/verify-release-candidate.sh
b/dev/release/verify-release-candidate.sh
index cda3993..aa6a8b6 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -434,7 +434,7 @@ test_cpp() {
export BUILD_DRIVER_POSTGRESQL=0
# Snowflake driver requires snowflake creds for testing
export BUILD_DRIVER_SNOWFLAKE=0
- "${ADBC_DIR}/ci/scripts/cpp_test.sh" "${ADBC_SOURCE_DIR}"
"${ARROW_TMPDIR}/cpp-build" "${install_prefix}"
+ "${ADBC_DIR}/ci/scripts/cpp_test.sh" "${ARROW_TMPDIR}/cpp-build"
"${install_prefix}"
export BUILD_DRIVER_FLIGHTSQL=1
export BUILD_DRIVER_POSTGRESQL=1
export BUILD_DRIVER_SNOWFLAKE=1