diff --git a/.github/workflows/sqlx.yml b/.github/workflows/sqlx.yml index a234c9d7a9..50ef29dd92 100644 --- a/.github/workflows/sqlx.yml +++ b/.github/workflows/sqlx.yml @@ -301,6 +301,22 @@ jobs: SQLX_OFFLINE_DIR: .sqlx RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" + # Run tests again with implied linux user + - run: | + SKIP_ARGS=() + for test in $PG_ISOLATED_TESTS; do + SKIP_ARGS+=(--skip "$test") + done + cargo test \ + --no-default-features \ + --features any,postgres,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }} \ + -- \ + "${SKIP_ARGS[@]}" + env: + DATABASE_URL: postgres:///sqlx?password=runner-password + SQLX_OFFLINE_DIR: .sqlx + RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" + # Run the `test-attr` test again to cover cleanup. - run: > cargo test diff --git a/sqlx-postgres/Cargo.toml b/sqlx-postgres/Cargo.toml index d5bf41f9b1..701cabff85 100644 --- a/sqlx-postgres/Cargo.toml +++ b/sqlx-postgres/Cargo.toml @@ -64,7 +64,7 @@ num-bigint = { version = "0.4.3", optional = true } smallvec = { version = "1.13.1" } stringprep = "0.1.2" tracing = { version = "0.1.37", features = ["log"] } -whoami = { version = "2.0.2", default-features = false } +whoami = { version = "2.0.2", features = ["std"], default-features = false } dotenvy.workspace = true thiserror.workspace = true diff --git a/tests/postgres/setup.sql b/tests/postgres/setup.sql index 49b7fcfeea..6a1b925abe 100644 --- a/tests/postgres/setup.sql +++ b/tests/postgres/setup.sql @@ -1,3 +1,6 @@ +-- Create extra user to be used on runner +CREATE USER runner WITH SUPERUSER PASSWORD 'runner-password'; + -- https://www.postgresql.org/docs/current/ltree.html CREATE EXTENSION IF NOT EXISTS ltree;