chore: Fix warnings for custom postgres_## cfg flags (#3950)

* chore: Fix warnings for custom postgres_## cfg flags

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

* pr feedback - reorder cfg allowance; enable test_pg_copy_chunked test

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

* refactor(postgres): Remove two more deprecated cfg flag uses (from docstrings)

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

* refactor(ci): Use separate job for postgres ssl auth tests

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

---------

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
This commit is contained in:
iamjpotts
2025-08-18 19:17:45 -04:00
committed by GitHub
parent 1f7af3abc2
commit e77f32ea5e
7 changed files with 18 additions and 48 deletions

View File

@@ -221,9 +221,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
- env:
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: -D warnings --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}"
run: >
cargo build
--no-default-features
@@ -245,9 +243,7 @@ jobs:
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx
SQLX_OFFLINE_DIR: .sqlx
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}"
# Run the `test-attr` test again to cover cleanup.
- run: >
@@ -258,9 +254,7 @@ jobs:
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx
SQLX_OFFLINE_DIR: .sqlx
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}"
- if: matrix.tls != 'none'
run: >
@@ -270,9 +264,7 @@ jobs:
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt
SQLX_OFFLINE_DIR: .sqlx
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}"
# Remove test artifacts
- run: cargo clean -p sqlx
@@ -286,9 +278,7 @@ jobs:
env:
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: -D warnings --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}"
# Test macros in offline mode (still needs DATABASE_URL to run)
- run: >
@@ -300,9 +290,7 @@ jobs:
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}"
postgres-ssl-auth:
name: Postgres SSL Auth
@@ -334,9 +322,7 @@ jobs:
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: postgres://postgres@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslkey=.%2Ftests%2Fcerts%2Fkeys%2Fclient.key&sslcert=.%2Ftests%2Fcerts%2Fclient.crt
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}_client_ssl
RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}"
mysql:
name: MySQL