From 7569ef89188ddb9e3cd4b40e84c33323725b3862 Mon Sep 17 00:00:00 2001 From: mrizzi Date: Tue, 12 Mar 2024 11:24:52 +0100 Subject: [PATCH] PostgreSQL embedded: tests use system temp dir for installation Signed-off-by: mrizzi --- .github/workflows/backend.yaml | 2 +- graph/Cargo.toml | 1 + graph/src/graph/mod.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend.yaml b/.github/workflows/backend.yaml index 100672649..13780d5e0 100644 --- a/.github/workflows/backend.yaml +++ b/.github/workflows/backend.yaml @@ -41,6 +41,6 @@ jobs: - name: Clippy run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::unwrap_used - name: Test - run: cargo test -- --test-threads=1 --nocapture + run: cargo test -- --nocapture env: RUST_LOG: debug diff --git a/graph/Cargo.toml b/graph/Cargo.toml index d4a528309..b005bd409 100644 --- a/graph/Cargo.toml +++ b/graph/Cargo.toml @@ -26,6 +26,7 @@ async-trait = "0.1.74" lenient_semver = "0.4.2" cpe = "0.1.3" postgresql_embedded = { version = "0.6.2", features = ["blocking", "bundled", "tokio" ] } +tempfile = "3" [dev-dependencies] diff --git a/graph/src/graph/mod.rs b/graph/src/graph/mod.rs index 88ab535dd..7da5a4f7e 100644 --- a/graph/src/graph/mod.rs +++ b/graph/src/graph/mod.rs @@ -99,6 +99,7 @@ impl Graph { username: "postgres".to_string(), password: "trustify".to_string(), temporary: true, + installation_dir: tempfile::tempdir()?.into_path(), ..Default::default() };