Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 186 additions & 56 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
- "ci/**"
- "go/**"
- "python/**"
- "compose.yaml"
- ".github/workflows/integration.yml"
push:
branches-ignore:
Expand All @@ -35,6 +36,7 @@ on:
- "ci/**"
- "go/**"
- "python/**"
- "compose.yaml"
- ".github/workflows/integration.yml"

concurrency:
Expand Down Expand Up @@ -172,8 +174,8 @@ jobs:
run: |
docker compose down

postgresql:
name: "PostgreSQL Integration Tests"
postgresql-build:
name: "PostgreSQL Build"
runs-on: ubuntu-latest
steps:
- name: Free up disk space
Expand Down Expand Up @@ -216,74 +218,202 @@ jobs:
run: |
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build"
- name: Configure Integration Env Vars
# Artifact actions do not preserve symlinks, so archive the build tree and
# the generated Python extension/library files ourselves.
- name: Archive PostgreSQL build
run: |
pip install python-dotenv[cli]
python -m dotenv -f .env list --format simple | tee -a $GITHUB_ENV
echo "ADBC_USE_ASAN=ON" >> $GITHUB_ENV
echo "ADBC_USE_UBSAN=ON" >> $GITHUB_ENV
tar --create --gzip --file postgresql-build.tgz \
build \
python/adbc_driver_manager \
python/adbc_driver_postgresql
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: postgresql-build
retention-days: 3
path: postgresql-build.tgz

- name: Test PostgreSQL Driver - postgres 14
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
PYTEST_ADDOPTS: "--error-for-skips"
postgresql-test:
name: "PostgreSQL (14-18)"
needs: postgresql-build
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
env POSTGRES_VERSION=14 docker compose up --wait --detach postgres-test
./ci/scripts/cpp_test.sh "$(pwd)/build"
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
docker compose rm -fsv
- name: Test PostgreSQL Driver - postgres 15
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
PYTEST_ADDOPTS: "--error-for-skips"
# Preinstalled tools use a lot of disk space, free up some space
# https://github.com/actions/runner-images/issues/2840
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Get Date
id: get-date
run: |
env POSTGRES_VERSION=15 docker compose up --wait --detach postgres-test
./ci/scripts/cpp_test.sh "$(pwd)/build"
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
docker compose rm -fsv
- name: Test PostgreSQL Driver - postgres 16
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
PYTEST_ADDOPTS: "--error-for-skips"
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
- name: Cache Conda
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/conda_pkgs_dir
key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
miniforge-version: latest
use-only-tar-bz2: false
use-mamba: true
- name: Install Dependencies
run: |
env POSTGRES_VERSION=16 docker compose up --wait --detach postgres-test
./ci/scripts/cpp_test.sh "$(pwd)/build"
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
docker compose rm -fsv
- name: Test PostgreSQL Driver - postgres 17
./ci/scripts/remamba.sh install -c conda-forge \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt
pip install pytest-error-for-skips
- name: Work around ASAN issue (GH-1617)
run: |
sudo sysctl vm.mmap_rnd_bits=28
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: postgresql-build
- name: Extract PostgreSQL build
run: |
tar --extract --gzip --file postgresql-build.tgz
echo "PYTHONPATH=$(pwd)/python/adbc_driver_manager:$(pwd)/python/adbc_driver_postgresql" >> "$GITHUB_ENV"
- name: Run PostgreSQL 14-18 tests
env:
ADBC_POSTGRESQL_TEST_URI: postgresql://localhost:5432/postgres?user=postgres&password=password
ADBC_USE_ASAN: "ON"
ADBC_USE_UBSAN: "ON"
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
PYTEST_ADDOPTS: "--error-for-skips"
run: |
env POSTGRES_VERSION=17 docker compose up --wait --detach postgres-test
./ci/scripts/cpp_test.sh "$(pwd)/build"
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
docker compose rm -fsv
- name: Test PostgreSQL Driver - postgres 18
for postgres_version in 14 15 16 17 18; do
echo "::group::PostgreSQL $postgres_version"
export POSTGRES_VERSION="$postgres_version"
docker compose up --wait --detach postgres-test
./ci/scripts/cpp_test.sh "$(pwd)/build"
env PYTEST_ADDOPTS=--error-for-skips \
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
if [ "$postgres_version" = "18" ]; then
uv --project=./c/driver/postgresql/validation/ run \
ci/scripts/validate.sh "$(pwd)" --vendor postgresql
fi
docker compose stop postgres-test
docker compose rm --force --stop --volumes postgres-test
echo "::endgroup::"
done
- name: Capture PostgreSQL logs
if: failure()
run: |
docker compose logs postgres-test
postgresql-vendor-test:
name: "PostgreSQL (${{ matrix.name }})"
needs: postgresql-build
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- name: AlloyDB Omni
service: alloydb-omni-test
vendor: alloydb-omni
uri: postgresql://localhost:5440/postgres?user=postgres&password=password
experimental: false
- name: Citus
service: citus-test
vendor: citus
uri: postgresql://localhost:5434/postgres?user=postgres&password=password
experimental: false
- name: CockroachDB
service: cockroachdb-test
vendor: cockroachdb
uri: postgresql://root@localhost:5435/postgres?sslmode=disable
experimental: false
- name: CrateDB
service: cratedb-test
vendor: cratedb
uri: postgresql://crate@localhost:5436/doc?sslmode=disable
experimental: true
- name: ParadeDB
service: paradedb-test
vendor: paradedb
uri: postgresql://localhost:5437/postgres?user=postgres&password=password
experimental: false
- name: TimescaleDB
service: timescaledb-test
vendor: timescaledb
uri: postgresql://localhost:5438/postgres?user=postgres&password=password
experimental: false
- name: YugabyteDB
service: yugabytedb-test
vendor: yugabytedb
uri: postgresql://localhost:5439/yugabyte?user=yugabyte&password=yugabyte
experimental: false
# Currently fails, but could be supported in the future.
# https://github.com/apache/arrow-adbc/issues/1755
# - name: CedarDB
# service: cedardb-test
# vendor: cedardb
# uri: postgresql://localhost:5433/postgres?user=postgres&password=CedarDB2026%21
# experimental: true
steps:
- name: Free up disk space
run: |
# Preinstalled tools use a lot of disk space, free up some space
# https://github.com/actions/runner-images/issues/2840
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Get Date
id: get-date
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
- name: Cache Conda
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/conda_pkgs_dir
key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
miniforge-version: latest
use-only-tar-bz2: false
use-mamba: true
- name: Install Dependencies
run: |
./ci/scripts/remamba.sh install -c conda-forge \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt
pip install pytest-error-for-skips
- name: Work around ASAN issue (GH-1617)
run: |
sudo sysctl vm.mmap_rnd_bits=28
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: postgresql-build
- name: Extract PostgreSQL build
run: |
tar --extract --gzip --file postgresql-build.tgz
echo "PYTHONPATH=$(pwd)/python/adbc_driver_manager:$(pwd)/python/adbc_driver_postgresql" >> "$GITHUB_ENV"
- name: Start ${{ matrix.name }}
run: |
docker compose up --wait --detach "${{ matrix.service }}"
- name: Run validation suite
env:
ADBC_POSTGRESQL_TEST_URI: ${{ matrix.uri }}
ADBC_USE_ASAN: "ON"
ADBC_USE_UBSAN: "ON"
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
PYTEST_ADDOPTS: "--error-for-skips"
run: |
env POSTGRES_VERSION=18 docker compose up --wait --detach postgres-test
./ci/scripts/cpp_test.sh "$(pwd)/build"
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
docker compose rm -fsv
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Run PostgreSQL Validation Suite
uv --project=./c/driver/postgresql/validation/ run \
ci/scripts/validate.sh "$(pwd)" --vendor "${{ matrix.vendor }}"
- name: Capture ${{ matrix.name }} logs
if: failure()
run: |
env POSTGRES_VERSION=18 docker compose up --wait --detach postgres-test
env BUILD_ALL=0 BUILD_DRIVER_POSTGRESQL=1 uv --project=./c/driver/postgresql/validation/ run ci/scripts/validate.sh $(pwd)
docker compose down
docker compose logs "${{ matrix.service }}"

flightsql_interop:
name: "FlightSQL C# Interop"
Expand Down
2 changes: 1 addition & 1 deletion c/driver/postgresql/validation/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ dependencies = [
]

[tool.uv.sources]
adbc-drivers-validation = { git = "https://github.com/adbc-drivers/validation", rev = "ffb8c9e9b76b2953525e67f5305497587ced1edd" }
adbc-drivers-validation = { git = "https://github.com/adbc-drivers/validation", rev = "575a41bfd96b09d9d8a057d0ea1e66a27a315475" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 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.

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "l",
"flags": ["nullable"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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.

// part: setup_query

CREATE TABLE test_timestamp (
idx INT,
res TIMESTAMP(6)
);

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "tsu:",
"flags": ["nullable"]
}
]
}

// part: expected

{"res": null}
{"res": -9223372036854775}
{"res": 946684800000000}
{"res": 1684158330000000}
{"res": 9223372036854775}
Loading
Loading