Use inmemory file system for imag-link tests
This commit is contained in:
parent
b0a5e1727e
commit
94928c33ca
3 changed files with 18 additions and 2 deletions
|
@ -393,6 +393,10 @@ version = \"0.3.0\"\
|
|||
fn enable_logging(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn use_inmemory_fs(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
fn generate_test_config() -> Option<Configuration> {
|
||||
|
|
|
@ -289,6 +289,10 @@ pub trait InternalConfiguration {
|
|||
fn enable_logging(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn use_inmemory_fs(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> InternalConfiguration for App<'a, 'a> {}
|
||||
|
|
|
@ -35,7 +35,7 @@ use error::RuntimeErrorKind;
|
|||
use error::MapErrInto;
|
||||
use logger::ImagLogger;
|
||||
|
||||
use libimagstore::store::Store;
|
||||
use libimagstore::store::{Store, InMemoryFileAbstraction};
|
||||
use spec::CliSpec;
|
||||
|
||||
/// The Runtime object
|
||||
|
@ -150,7 +150,15 @@ impl<'a> Runtime<'a> {
|
|||
write!(stderr(), "Store-config: {:?}\n", store_config).ok();
|
||||
}
|
||||
|
||||
Store::new(storepath, store_config).map(|store| {
|
||||
let store_result = if cli_app.use_inmemory_fs() {
|
||||
Store::new_with_backend(storepath,
|
||||
store_config,
|
||||
Box::new(InMemoryFileAbstraction::new()))
|
||||
} else {
|
||||
Store::new(storepath, store_config)
|
||||
};
|
||||
|
||||
store_result.map(|store| {
|
||||
Runtime {
|
||||
cli_matches: matches,
|
||||
configuration: config,
|
||||
|
|
Loading…
Reference in a new issue