From b2d1068d3883c3ac914ca59467944799659845c5 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Sat, 11 Feb 2023 02:40:08 +0100 Subject: [PATCH] Start testing on Postgres 15 and drop Postgres 10 (#2193) * CHANGELOG: mention that users should upgrade CLI * Drop postgres 10 start testing postgres 15 --------- Co-authored-by: Austin Bonander --- .github/workflows/sqlx.yml | 2 +- sqlx-core/src/acquire.rs | 6 +++--- tests/docker-compose.yml | 24 ++++++++++++------------ tests/postgres/types.rs | 4 ++-- tests/x.py | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/sqlx.yml b/.github/workflows/sqlx.yml index 115a7268c2..2ca687ca2b 100644 --- a/.github/workflows/sqlx.yml +++ b/.github/workflows/sqlx.yml @@ -176,7 +176,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - postgres: [14, 10] + postgres: [15, 11] runtime: [async-std, tokio] tls: [native-tls, rustls, none] needs: check diff --git a/sqlx-core/src/acquire.rs b/sqlx-core/src/acquire.rs index 3bd7698b07..c9d7fb215c 100644 --- a/sqlx-core/src/acquire.rs +++ b/sqlx-core/src/acquire.rs @@ -15,7 +15,7 @@ use std::ops::{Deref, DerefMut}; /// /// ```rust /// # use sqlx::{Acquire, postgres::Postgres, error::BoxDynError}; -/// # #[cfg(any(postgres_9_6, postgres_14))] +/// # #[cfg(any(postgres_9_6, postgres_15))] /// async fn run_query<'a, A>(conn: A) -> Result<(), BoxDynError> /// where /// A: Acquire<'a, Database = Postgres>, @@ -35,7 +35,7 @@ use std::ops::{Deref, DerefMut}; /// ```rust /// # use std::future::Future; /// # use sqlx::{Acquire, postgres::Postgres, error::BoxDynError}; -/// # #[cfg(any(postgres_9_6, postgres_14))] +/// # #[cfg(any(postgres_9_6, postgres_15))] /// fn run_query<'a, 'c, A>(conn: A) -> impl Future> + Send + 'a /// where /// A: Acquire<'c, Database = Postgres> + Send + 'a, @@ -57,7 +57,7 @@ use std::ops::{Deref, DerefMut}; /// /// ```rust /// # use sqlx::{postgres::PgConnection, error::BoxDynError}; -/// # #[cfg(any(postgres_9_6, postgres_14))] +/// # #[cfg(any(postgres_9_6, postgres_15))] /// async fn run_query(conn: &mut PgConnection) -> Result<(), BoxDynError> { /// sqlx::query!("SELECT 1 as v").fetch_one(&mut *conn).await?; /// sqlx::query!("SELECT 2 as v").fetch_one(&mut *conn).await?; diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index f6d108308a..030d1bacff 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -75,16 +75,16 @@ services: MYSQL_DATABASE: sqlx # - # PostgreSQL 14.x, 13.x, 12.x, 11.x 10.x + # PostgreSQL 15.x, 14.x, 13.x, 12.x, 11.x # https://www.postgresql.org/support/versioning/ # - postgres_14: + postgres_15: build: context: . dockerfile: postgres/Dockerfile args: - VERSION: 14 + VERSION: 15 ports: - 5432 environment: @@ -98,12 +98,12 @@ services: command: > -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key - postgres_13: + postgres_14: build: context: . dockerfile: postgres/Dockerfile args: - VERSION: 13 + VERSION: 14 ports: - 5432 environment: @@ -117,12 +117,12 @@ services: command: > -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key - postgres_12: + postgres_13: build: context: . dockerfile: postgres/Dockerfile args: - VERSION: 12 + VERSION: 13 ports: - 5432 environment: @@ -136,14 +136,14 @@ services: command: > -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key - postgres_11: + postgres_12: build: context: . dockerfile: postgres/Dockerfile args: - VERSION: 11 + VERSION: 12 ports: - - 5432 + - 5432 environment: POSTGRES_DB: sqlx POSTGRES_USER: postgres @@ -155,12 +155,12 @@ services: command: > -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key - postgres_10: + postgres_11: build: context: . dockerfile: postgres/Dockerfile args: - VERSION: 10 + VERSION: 11 ports: - 5432 environment: diff --git a/tests/postgres/types.rs b/tests/postgres/types.rs index a05fdd0130..d9d1f04d10 100644 --- a/tests/postgres/types.rs +++ b/tests/postgres/types.rs @@ -549,7 +549,7 @@ test_prepared_type!(money_vec>(Postgres, // FIXME: needed to disable `ltree` tests in version that don't have a binary format for it // but `PgLTree` should just fall back to text format -#[cfg(postgres_14)] +#[cfg(any(postgres_14, postgres_15))] test_type!(ltree(Postgres, "'Foo.Bar.Baz.Quux'::ltree" == sqlx::postgres::types::PgLTree::from_str("Foo.Bar.Baz.Quux").unwrap(), "'Alpha.Beta.Delta.Gamma'::ltree" == sqlx::postgres::types::PgLTree::from_iter(["Alpha", "Beta", "Delta", "Gamma"]).unwrap(), @@ -557,7 +557,7 @@ test_type!(ltree(Postgres, // FIXME: needed to disable `ltree` tests in version that don't have a binary format for it // but `PgLTree` should just fall back to text format -#[cfg(postgres_14)] +#[cfg(any(postgres_14, postgres_15))] test_type!(ltree_vec>(Postgres, "array['Foo.Bar.Baz.Quux', 'Alpha.Beta.Delta.Gamma']::ltree[]" == vec![ diff --git a/tests/x.py b/tests/x.py index 1d03ed7a99..e5cca2971f 100755 --- a/tests/x.py +++ b/tests/x.py @@ -169,7 +169,7 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data # postgres # - for version in ["14", "13", "12", "11", "10"]: + for version in ["15", "14", "13", "12", "11"]: run( f"cargo test --no-default-features --features macros,any,unstable-all-types,postgres,runtime-{runtime},tls-{tls}", comment=f"test postgres {version}", @@ -178,7 +178,7 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data ) ## +ssl - for version in ["14", "13", "12", "11", "10"]: + for version in ["15", "14", "13", "12", "11"]: run( f"cargo test --no-default-features --features macros,any,_unstable-all-types,postgres,runtime-{runtime},tls-{tls}", comment=f"test postgres {version} ssl",