From 78bd07b6a21faf83b1b01b2ea3906673ed648de4 Mon Sep 17 00:00:00 2001 From: Jonathan <94441036+zeapoz@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:51:44 +0200 Subject: [PATCH] chore: test db namespaces (#88) * chore: use different namespaces for different dbs during testing * ci: run all tests in the workspace --- .github/workflows/ci.yml | 2 +- state-reconstruct-storage/src/reconstruction.rs | 4 +++- state-reconstruct-storage/src/snapshot.rs | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91b2f0a..00ff627 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: fmt --all --check, check --all-targets --all-features, clippy --all-targets --all-features -- -D warnings, - test --all-targets --all-features + test --all-targets --all-features --workspace ] steps: - uses: actions/checkout@v4 diff --git a/state-reconstruct-storage/src/reconstruction.rs b/state-reconstruct-storage/src/reconstruction.rs index e5dabaa..a50b16d 100644 --- a/state-reconstruct-storage/src/reconstruction.rs +++ b/state-reconstruct-storage/src/reconstruction.rs @@ -119,9 +119,11 @@ mod tests { use super::*; + const TEST_DB_PATH: &str = "snapshot_test_db"; + #[test] fn basics() { - let db_dir = PathBuf::from("./test_inner_db"); + let db_dir = PathBuf::from(TEST_DB_PATH); { let db = ReconstructionDatabase::new(db_dir.clone()).unwrap(); let zero = db.get_last_repeated_key_index().unwrap(); diff --git a/state-reconstruct-storage/src/snapshot.rs b/state-reconstruct-storage/src/snapshot.rs index 9d03f52..a26f2ac 100644 --- a/state-reconstruct-storage/src/snapshot.rs +++ b/state-reconstruct-storage/src/snapshot.rs @@ -200,9 +200,11 @@ mod tests { use super::*; + const TEST_DB_PATH: &str = "reconstruction_test_db"; + #[test] fn basics() { - let db_dir = PathBuf::from("./test_inner_db"); + let db_dir = PathBuf::from(TEST_DB_PATH); { let db = SnapshotDatabase::new(db_dir.clone()).unwrap(); let zero = db.get_last_repeated_key_index().unwrap();