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
101 changes: 53 additions & 48 deletions .github/workflows/IntegrationTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: 'true'

Expand All @@ -39,7 +39,7 @@ jobs:
make format-check

linux-tests:
name: Linux Tests
name: Linux (pg-17)
needs: format-check
runs-on: ubuntu-latest

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
id: cache_key
working-directory: ./duckdb
run: |
DUCKDB_VERSION=$(git rev-parse --short HEAD)
DUCKDB_VERSION=$(git rev-parse --short=10 HEAD)
KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION"
echo "value=${KEY}" >> "${GITHUB_OUTPUT}"

Expand All @@ -82,15 +82,6 @@ jobs:
path: ${{ github.workspace }}/ccache
key: ${{ steps.cache_key.outputs.value }}

- name: Setup Postgres
uses: ikalnytskyi/action-setup-postgres@v8
with:
postgres-version: 17
username: 'postgres'
password: 'postgres'
database: 'postgres'
port: '5432'

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11.1
with:
Expand All @@ -106,28 +97,40 @@ jobs:
path: ${{ github.workspace }}/ccache
key: ${{ steps.cache_key.outputs.value }}

- name: Setup Postgres
uses: ikalnytskyi/action-setup-postgres@v8
with:
postgres-version: 17
username: 'postgres'
password: 'postgres'
database: 'postgres'
port: '5432'

- name: Run tests
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
POSTGRES_TEST_DATABASE_AVAILABLE: 1
POSTGRES_TEST_SLOW: 1
LOCAL_EXTENSION_REPO: 'build/release/repository'
run: |
source ./create-postgres-tables.sh
psql -d postgresscanner -c "SELECT 42"
./build/release/test/unittest 'test/sql/*'

linux-pgbouncer:
name: Linux PgBouncer
name: Linux PgBouncer (${{ matrix.postgres.name }})
needs: linux-tests
runs-on: ubuntu-latest

strategy:
matrix:
pg_version: [14, 18]
postgres:
- name: pg-14
version: 14
- name: pg-18
version: 18

env:
GEN: ninja
Expand Down Expand Up @@ -159,7 +162,7 @@ jobs:
id: cache_key
working-directory: ./duckdb
run: |
DUCKDB_VERSION=$(git rev-parse --short HEAD)
DUCKDB_VERSION=$(git rev-parse --short=10 HEAD)
KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION"
echo "value=${KEY}" >> "${GITHUB_OUTPUT}"

Expand All @@ -169,10 +172,19 @@ jobs:
path: ${{ github.workspace }}/ccache
key: ${{ steps.cache_key.outputs.value }}

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11.1
with:
vcpkgGitCommitId: 84bab45d415d22042bd0b9081aea57f362da3f35

- name: Build extension
run: |
make release

- name: Setup Postgres
uses: ikalnytskyi/action-setup-postgres@v8
with:
postgres-version: ${{ matrix.pg_version }}
postgres-version: ${{ matrix.postgres.version }}
username: 'postgres'
password: 'postgres'
database: 'postgres'
Expand All @@ -198,15 +210,6 @@ jobs:
sudo cat /etc/pgbouncer/pgbouncer.ini
sudo systemctl restart pgbouncer

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11.1
with:
vcpkgGitCommitId: 84bab45d415d22042bd0b9081aea57f362da3f35

- name: Build extension
run: |
make release

- name: Setup test data
env:
PGHOST: localhost
Expand All @@ -224,7 +227,6 @@ jobs:
PGPASSWORD: postgres
PGSSLMODE: require
POSTGRES_TEST_DATABASE_AVAILABLE: 1
POSTGRES_TEST_SLOW: 1
LOCAL_EXTENSION_REPO: 'build/release/repository'
run: |
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
Expand All @@ -238,7 +240,6 @@ jobs:
PGPASSWORD: postgres
PGSSLMODE: require
POSTGRES_TEST_DATABASE_AVAILABLE: 1
POSTGRES_TEST_SLOW: 1
LOCAL_EXTENSION_REPO: 'build/release/repository'
run: |
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
Expand All @@ -252,14 +253,18 @@ jobs:
path: |
/var/log/postgresql/pgbouncer.log

linux-relassert:
name: Linux RelAssert
linux-sanitized:
name: Linux ${{ matrix.sanitizer.name }} (pg-17)
needs: linux-tests
runs-on: ubuntu-latest

strategy:
matrix:
threadsan: [0, 1]
sanitizer:
- name: ASan
threadsan_enabled: 0
- name: TSan
threadsan_enabled: 1

env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
Expand Down Expand Up @@ -291,7 +296,7 @@ jobs:
id: cache_key
working-directory: ./duckdb
run: |
DUCKDB_VERSION=$(git rev-parse --short HEAD)
DUCKDB_VERSION=$(git rev-parse --short=10 HEAD)
KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION"-relassert-${{ matrix.threadsan }}
echo "value=${KEY}" >> "${GITHUB_OUTPUT}"

Expand All @@ -301,24 +306,14 @@ jobs:
path: ${{ github.workspace }}/ccache
key: ${{ steps.cache_key.outputs.value }}

- name: Setup Postgres
uses: ikalnytskyi/action-setup-postgres@v8
with:
postgres-version: 18
username: 'postgres'
password: 'postgres'
database: 'postgres'
port: '5432'
ssl: true

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11.1
with:
vcpkgGitCommitId: 84bab45d415d22042bd0b9081aea57f362da3f35

- name: Build extension
env:
THREADSAN: ${{ matrix.threadsan }}
THREADSAN: ${{ matrix.sanitizer.threadsan_enabled }}
run: |
make relassert
cat ./build/relassert/src/CMakeFiles/duckdb.dir/flags.make
Expand All @@ -331,6 +326,16 @@ jobs:
path: ${{ github.workspace }}/ccache
key: ${{ steps.cache_key.outputs.value }}

- name: Setup Postgres
uses: ikalnytskyi/action-setup-postgres@v8
with:
postgres-version: 17
username: 'postgres'
password: 'postgres'
database: 'postgres'
port: '5432'
ssl: true

- name: Run tests
env:
PGHOST: localhost
Expand All @@ -343,10 +348,10 @@ jobs:
run: |
source ./create-postgres-tables.sh
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
./build/relassert/test/unittest 'test/sql/*'
./build/relassert/test/unittest

windows-tests:
name: Windows Tests
name: Windows (pg-17)
needs: linux-tests
runs-on: windows-latest

Expand Down Expand Up @@ -401,7 +406,7 @@ jobs:
working-directory: ./duckdb
shell: bash
run: |
DUCKDB_VERSION=$(git rev-parse --short HEAD)
DUCKDB_VERSION=$(git rev-parse --short=10 HEAD)
KEY="${{ runner.os }}-${{ runner.arch }}-$DUCKDB_VERSION"
echo "value=${KEY}" >> "${GITHUB_OUTPUT}"

Expand Down Expand Up @@ -438,7 +443,7 @@ jobs:
- name: Setup Postgres
uses: ikalnytskyi/action-setup-postgres@v8
with:
postgres-version: '18'
postgres-version: '17'
username: 'postgres'
password: 'postgres'
database: 'postgres'
Expand Down Expand Up @@ -468,4 +473,4 @@ jobs:
shell: bash
run: |
psql -d postgresscanner -c "SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid()"
./build/release/test/unittest 'test/sql/*'
./build/release/test/unittest
1 change: 0 additions & 1 deletion extension_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
duckdb_extension_load(postgres_scanner
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
DONT_LINK
LOAD_TESTS
)

duckdb_extension_load(tpch)
Expand Down
14 changes: 7 additions & 7 deletions test/sql/misc/postgres_binary.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ ATTACH 'dbname=postgresscanner' AS s (TYPE POSTGRES)

# straightforward integer copy
statement ok
COPY (SELECT i::INT AS i FROM range(100) t(i)) TO '__TEST_DIR__/pg_binary.bin' (FORMAT postgres_binary);
COPY (SELECT i::INT AS i FROM range(100) t(i)) TO '{TEST_DIR}/pg_binary.bin' (FORMAT postgres_binary);

statement ok
CREATE OR REPLACE TABLE s.binary_copy_test(i INTEGER);

statement ok
CALL postgres_execute('s', 'COPY binary_copy_test FROM ''__WORKING_DIRECTORY__/__TEST_DIR__/pg_binary.bin'' (FORMAT binary)')
CALL postgres_execute('s', 'COPY binary_copy_test FROM ''{WORKING_DIRECTORY}/{TEST_DIR}/pg_binary.bin'' (FORMAT binary)')

query IIII
SELECT COUNT(*), MIN(i), MAX(i), SUM(i) FROM s.binary_copy_test
Expand All @@ -43,10 +43,10 @@ statement ok
CREATE OR REPLACE TABLE s.binary_copy_test AS FROM all_types_tbl LIMIT 0;

statement ok
COPY all_types_tbl TO '__TEST_DIR__/pg_binary.bin' (FORMAT postgres_binary);
COPY all_types_tbl TO '{TEST_DIR}/pg_binary.bin' (FORMAT postgres_binary);

statement ok
CALL postgres_execute('s', 'COPY binary_copy_test FROM ''__WORKING_DIRECTORY__/__TEST_DIR__/pg_binary.bin'' (FORMAT binary)')
CALL postgres_execute('s', 'COPY binary_copy_test FROM ''{WORKING_DIRECTORY}/{TEST_DIR}/pg_binary.bin'' (FORMAT binary)')

query I nosort all_types
FROM all_types_tbl
Expand All @@ -59,7 +59,7 @@ SELECT * FROM s.binary_copy_test

# test an unsupported type
statement error
COPY (SELECT 42::UINT32) TO '__TEST_DIR__/pg_binary.bin' (FORMAT postgres_binary);
COPY (SELECT 42::UINT32) TO '{TEST_DIR}/pg_binary.bin' (FORMAT postgres_binary);
----
not supported

Expand All @@ -68,10 +68,10 @@ statement ok
CREATE TABLE read_tbl(i int);

statement ok
COPY (SELECT 42::INTEGER AS i) TO '__TEST_DIR__/pg_binary_read.bin' (FORMAT postgres_binary);
COPY (SELECT 42::INTEGER AS i) TO '{TEST_DIR}/pg_binary_read.bin' (FORMAT postgres_binary);

statement ok
COPY read_tbl FROM '__TEST_DIR__/pg_binary_read.bin' (FORMAT postgres_binary);
COPY read_tbl FROM '{TEST_DIR}/pg_binary_read.bin' (FORMAT postgres_binary);

query I
SELECT * FROM read_tbl;
Expand Down
Loading
Loading