fix(test): don't create another 'state' directory when implementing ZebradTestDirExt (#4158)
* fix(test): don't create another 'state' directory when implementing ZebradTestDirExt * fix zebra_state_conflict() test
This commit is contained in:
parent
903eabdced
commit
315eebf09c
|
@ -1379,7 +1379,6 @@ fn zebra_state_conflict() -> Result<()> {
|
||||||
let mut dir_conflict_full = PathBuf::new();
|
let mut dir_conflict_full = PathBuf::new();
|
||||||
dir_conflict_full.push(dir_conflict.path());
|
dir_conflict_full.push(dir_conflict.path());
|
||||||
dir_conflict_full.push("state");
|
dir_conflict_full.push("state");
|
||||||
dir_conflict_full.push("state");
|
|
||||||
dir_conflict_full.push(format!(
|
dir_conflict_full.push(format!(
|
||||||
"v{}",
|
"v{}",
|
||||||
zebra_state::constants::DATABASE_FORMAT_VERSION
|
zebra_state::constants::DATABASE_FORMAT_VERSION
|
||||||
|
|
|
@ -5,7 +5,11 @@
|
||||||
//! Test functions in this file will not be run.
|
//! Test functions in this file will not be run.
|
||||||
//! This file is only for test library code.
|
//! This file is only for test library code.
|
||||||
|
|
||||||
use std::{env, path::Path, time::Duration};
|
use std::{
|
||||||
|
env,
|
||||||
|
path::{Path, PathBuf},
|
||||||
|
time::Duration,
|
||||||
|
};
|
||||||
|
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
|
|
||||||
|
@ -142,7 +146,7 @@ where
|
||||||
fn cache_config_update_helper(self, config: &mut ZebradConfig) -> Result<Self> {
|
fn cache_config_update_helper(self, config: &mut ZebradConfig) -> Result<Self> {
|
||||||
if !config.state.ephemeral {
|
if !config.state.ephemeral {
|
||||||
let dir = self.as_ref();
|
let dir = self.as_ref();
|
||||||
let cache_dir = dir.join("state");
|
let cache_dir = PathBuf::from(dir);
|
||||||
config.state.cache_dir = cache_dir;
|
config.state.cache_dir = cache_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue