From 491ed09233cd39ada30c1d435360516de401d9a5 Mon Sep 17 00:00:00 2001 From: Sergii Glushchenko Date: Fri, 12 Jul 2024 10:36:34 +0200 Subject: [PATCH] Make it easy to run cargo test locally (#4347) --- Makefile.ci.toml | 2 +- tests/cli_integration.rs | 1 + tests/database_upgrade.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.ci.toml b/Makefile.ci.toml index 3907ae01..1c823d44 100644 --- a/Makefile.ci.toml +++ b/Makefile.ci.toml @@ -110,7 +110,7 @@ run_task = { name = ["start-surrealdb", "test-api-integration", "stop-surrealdb" [tasks.test-database-upgrade] private = true command = "cargo" -env = { RUST_BACKTRACE = 1, RUST_LOG = "info" } +env = { RUST_BACKTRACE = 1, RUST_LOG = "info", RUSTFLAGS = "--cfg docker" } args = ["test", "--locked", "--no-default-features", "--features", "${_TEST_FEATURES}", "--workspace", "--test", "database_upgrade", "--", "database_upgrade", "--show-output"] diff --git a/tests/cli_integration.rs b/tests/cli_integration.rs index da7266fd..4af25e95 100644 --- a/tests/cli_integration.rs +++ b/tests/cli_integration.rs @@ -1109,6 +1109,7 @@ mod cli_integration { } info!("* The path is a valid directory"); + #[cfg(feature = "storage-surrealkv")] { let path = format!("surrealkv:{}", tempfile::tempdir().unwrap().path().display()); let temp_dir = tempfile::tempdir().unwrap(); diff --git a/tests/database_upgrade.rs b/tests/database_upgrade.rs index 418fb37c..e7c749ac 100644 --- a/tests/database_upgrade.rs +++ b/tests/database_upgrade.rs @@ -3,6 +3,7 @@ mod common; +#[cfg(docker)] mod database_upgrade { use super::common::docker::DockerContainer; use super::common::expected::Expected;