Make it easy to run cargo test locally (#4347)

This commit is contained in:
Sergii Glushchenko 2024-07-12 10:36:34 +02:00 committed by GitHub
parent 7d0e45be00
commit 491ed09233
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View file

@ -110,7 +110,7 @@ run_task = { name = ["start-surrealdb", "test-api-integration", "stop-surrealdb"
[tasks.test-database-upgrade] [tasks.test-database-upgrade]
private = true private = true
command = "cargo" 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"] args = ["test", "--locked", "--no-default-features", "--features", "${_TEST_FEATURES}", "--workspace", "--test", "database_upgrade", "--", "database_upgrade", "--show-output"]

View file

@ -1109,6 +1109,7 @@ mod cli_integration {
} }
info!("* The path is a valid directory"); info!("* The path is a valid directory");
#[cfg(feature = "storage-surrealkv")]
{ {
let path = format!("surrealkv:{}", tempfile::tempdir().unwrap().path().display()); let path = format!("surrealkv:{}", tempfile::tempdir().unwrap().path().display());
let temp_dir = tempfile::tempdir().unwrap(); let temp_dir = tempfile::tempdir().unwrap();

View file

@ -3,6 +3,7 @@
mod common; mod common;
#[cfg(docker)]
mod database_upgrade { mod database_upgrade {
use super::common::docker::DockerContainer; use super::common::docker::DockerContainer;
use super::common::expected::Expected; use super::common::expected::Expected;