From 994d8d6e36c294df6e65798e8a5cf4abc3962689 Mon Sep 17 00:00:00 2001 From: Kayh Date: Wed, 20 Dec 2023 21:13:13 -0500 Subject: [PATCH] try to fix ci --- dwn-server/tests/db.rs | 5 ++++- flake.nix | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dwn-server/tests/db.rs b/dwn-server/tests/db.rs index 856b2db..40caa2b 100644 --- a/dwn-server/tests/db.rs +++ b/dwn-server/tests/db.rs @@ -2,7 +2,10 @@ use sqlx::mysql::MySqlPoolOptions; #[tokio::test] async fn insert_record() { - dotenv::dotenv().ok(); + let existing = std::env::var("DATABASE_URL").is_ok(); + if !existing { + dotenv::dotenv().ok(); + } let db_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set"); diff --git a/flake.nix b/flake.nix index b2d974f..5a2b385 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,8 @@ devShells.default = pkgs.mkShell { buildInputs = with pkgs; - [ cargo-watch rust-analyzer rustBin mariadb ] ++ build_inputs; + [ cargo-watch mariadb rust-analyzer rustBin sqlx-cli ] + ++ build_inputs; nativeBuildInputs = native_build_inputs; LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath build_inputs;