From 36282e931b5d0f56ab985d565112963631584ca8 Mon Sep 17 00:00:00 2001 From: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> Date: Thu, 21 Aug 2025 23:40:58 -0400 Subject: [PATCH 1/2] refactor(sqlite): Resolve duplicate test target warning for macros.rs Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> --- .github/workflows/sqlx.yml | 4 ++-- Cargo.toml | 7 +------ tests/sqlite/macros.rs | 2 ++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sqlx.yml b/.github/workflows/sqlx.yml index 05d5da0a3b..f5de397000 100644 --- a/.github/workflows/sqlx.yml +++ b/.github/workflows/sqlx.yml @@ -181,7 +181,7 @@ jobs: - run: > cargo build --no-default-features - --test ${{ matrix.linking }}-macros + --test sqlite-macros --features any,macros,${{ matrix.linking }},_unstable-all-types,runtime-${{ matrix.runtime }} env: SQLX_OFFLINE: true @@ -193,7 +193,7 @@ jobs: - run: > cargo test --no-default-features - --test ${{ matrix.linking }}-macros + --test sqlite-macros --features any,macros,${{ matrix.linking }},_unstable-all-types,runtime-${{ matrix.runtime }} env: DATABASE_URL: sqlite://tests/sqlite/sqlite.db diff --git a/Cargo.toml b/Cargo.toml index 9c37eb4a5d..e253a15d57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -299,12 +299,7 @@ required-features = ["sqlite"] [[test]] name = "sqlite-macros" path = "tests/sqlite/macros.rs" -required-features = ["sqlite", "macros"] - -[[test]] -name = "sqlite-unbundled-macros" -path = "tests/sqlite/macros.rs" -required-features = ["sqlite-unbundled", "macros"] +required-features = ["macros"] # Also requires either sqlite or sqlite-unbundled [[test]] name = "sqlite-derives" diff --git a/tests/sqlite/macros.rs b/tests/sqlite/macros.rs index 0ab4dd56bf..601c7cfa3c 100644 --- a/tests/sqlite/macros.rs +++ b/tests/sqlite/macros.rs @@ -1,3 +1,5 @@ +#![cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))] + use sqlx::Sqlite; use sqlx_test::new; From 16eb3b660ec0583e166cf711220b0819505ba1e8 Mon Sep 17 00:00:00 2001 From: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> Date: Mon, 25 Aug 2025 18:08:17 -0400 Subject: [PATCH 2/2] refactor(sqlite): For macros tests, use _sqlite pseudo feature instead of #![cfg(...)] in the module Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> --- Cargo.toml | 2 +- tests/sqlite/macros.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e253a15d57..e8279e3148 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -299,7 +299,7 @@ required-features = ["sqlite"] [[test]] name = "sqlite-macros" path = "tests/sqlite/macros.rs" -required-features = ["macros"] # Also requires either sqlite or sqlite-unbundled +required-features = ["_sqlite", "macros"] [[test]] name = "sqlite-derives" diff --git a/tests/sqlite/macros.rs b/tests/sqlite/macros.rs index 601c7cfa3c..0ab4dd56bf 100644 --- a/tests/sqlite/macros.rs +++ b/tests/sqlite/macros.rs @@ -1,5 +1,3 @@ -#![cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))] - use sqlx::Sqlite; use sqlx_test::new;