From b43cc8aa3e1c8e136be88d8f4eefe07b8729c85a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 13 Dec 2024 04:06:26 +0100 Subject: [PATCH] `acrate_database`: Add connect tests --- .idea/runConfigurations/Test.xml | 22 ++++++++++++++++++++++ .idea/runConfigurations/Test_ignored.xml | 22 ++++++++++++++++++++++ acrate_database/Cargo.toml | 2 ++ acrate_database/tests/test_connect.rs | 15 +++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 .idea/runConfigurations/Test.xml create mode 100644 .idea/runConfigurations/Test_ignored.xml create mode 100644 acrate_database/tests/test_connect.rs diff --git a/.idea/runConfigurations/Test.xml b/.idea/runConfigurations/Test.xml new file mode 100644 index 0000000..42251ea --- /dev/null +++ b/.idea/runConfigurations/Test.xml @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Test_ignored.xml b/.idea/runConfigurations/Test_ignored.xml new file mode 100644 index 0000000..3eefd8a --- /dev/null +++ b/.idea/runConfigurations/Test_ignored.xml @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/acrate_database/Cargo.toml b/acrate_database/Cargo.toml index f920aef..f047be9 100644 --- a/acrate_database/Cargo.toml +++ b/acrate_database/Cargo.toml @@ -19,11 +19,13 @@ micronfig = { version = "0.3.0", optional = true } mime = "0.3.17" pretty_env_logger = { version = "0.5.0", optional = true } uuid = "1.11.0" +tokio = { version = "1.42.0", optional = true } [features] default = ["connect"] bin = ["diesel_migrations", "pretty_env_logger", "connect"] connect = ["micronfig"] +tests = ["tokio", "connect"] [lib] name = "acrate_database" diff --git a/acrate_database/tests/test_connect.rs b/acrate_database/tests/test_connect.rs new file mode 100644 index 0000000..9f11e45 --- /dev/null +++ b/acrate_database/tests/test_connect.rs @@ -0,0 +1,15 @@ +use acrate_database::connect::{connect_async, connect_sync}; + +#[test] +#[ignore] +fn test_connect_sync() -> diesel::ConnectionResult<()> { + connect_sync()?; + Ok(()) +} + +#[tokio::test] +#[ignore] +async fn test_connect_async() -> diesel::ConnectionResult<()> { + connect_async().await?; + Ok(()) +}