Skip to content

Commit f8afe99

Browse files
authored
fix: whoami regression to anonymous user (#4303)
1 parent 7d20938 commit f8afe99

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/sqlx.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,22 @@ jobs:
301301
SQLX_OFFLINE_DIR: .sqlx
302302
RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}"
303303
304+
# Run tests again with implied linux user
305+
- run: |
306+
SKIP_ARGS=()
307+
for test in $PG_ISOLATED_TESTS; do
308+
SKIP_ARGS+=(--skip "$test")
309+
done
310+
cargo test \
311+
--no-default-features \
312+
--features any,postgres,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }} \
313+
-- \
314+
"${SKIP_ARGS[@]}"
315+
env:
316+
DATABASE_URL: postgres:///sqlx?password=runner-password
317+
SQLX_OFFLINE_DIR: .sqlx
318+
RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}"
319+
304320
# Run the `test-attr` test again to cover cleanup.
305321
- run: >
306322
cargo test

sqlx-postgres/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ num-bigint = { version = "0.4.3", optional = true }
6464
smallvec = { version = "1.13.1" }
6565
stringprep = "0.1.2"
6666
tracing = { version = "0.1.37", features = ["log"] }
67-
whoami = { version = "2.0.2", default-features = false }
67+
whoami = { version = "2.0.2", features = ["std"], default-features = false }
6868

6969
dotenvy.workspace = true
7070
thiserror.workspace = true

tests/postgres/setup.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
-- Create extra user to be used on runner
2+
CREATE USER runner WITH SUPERUSER PASSWORD 'runner-password';
3+
14
-- https://www.postgresql.org/docs/current/ltree.html
25
CREATE EXTENSION IF NOT EXISTS ltree;
36

0 commit comments

Comments
 (0)