start implementing some logic to test the internal states of the scheduler

This commit is contained in:
Tamo 2022-09-26 17:36:06 +02:00 committed by Clément Renault
parent 2d1cc1a12d
commit 03de8669a2
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
4 changed files with 164 additions and 32 deletions

View file

@ -15,11 +15,6 @@ pub use task::{Kind, KindWithContent, Status, TaskView};
#[cfg(test)]
mod tests {
use milli::update::IndexerConfig;
use tempfile::TempDir;
use crate::IndexScheduler;
#[macro_export]
macro_rules! assert_smol_debug_snapshot {
($value:expr, @$snapshot:literal) => {{
@ -36,24 +31,8 @@ mod tests {
}};
}
pub fn index_scheduler() -> (IndexScheduler, TempDir) {
let dir = TempDir::new().unwrap();
(
IndexScheduler::new(
dir.path().join("db_path"),
dir.path().join("file_store"),
dir.path().join("indexes"),
1024 * 1024,
IndexerConfig::default(),
)
.unwrap(),
dir,
)
}
#[test]
fn simple_new() {
index_scheduler();
crate::IndexScheduler::test();
}
}