diff --git a/Cargo.toml b/Cargo.toml index 265260b0..d0be6c60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,6 +127,12 @@ rustls-native-certs = { version = "0.8", default-features = false } hashbrown = { version = "0.15", default-features = false } quick_cache = { version = "0.6", default-features = false } crossbeam-queue = { version = "0.3", default-features = false } +async-walkdir = "1.0.0" +pyo3 = "0.21.2" +tempfile = "3.10.1" +tracing-test = "0.2.4" +wasmtime = "21.0.1" +wasmtime-wasi = "21.0.1" [patch.crates-io] # Git dependency for `containerd-client` to: diff --git a/lib/saluki-components/Cargo.toml b/lib/saluki-components/Cargo.toml index c21902f2..1b84c20e 100644 --- a/lib/saluki-components/Cargo.toml +++ b/lib/saluki-components/Cargo.toml @@ -9,6 +9,7 @@ repository = { workspace = true } ahash = { workspace = true } async-compression = { workspace = true, features = ["tokio", "zlib"] } async-trait = { workspace = true } +async-walkdir = { workspace = true } bitmask-enum = { workspace = true } bytes = { workspace = true } bytesize = { workspace = true } @@ -31,6 +32,7 @@ nom = { workspace = true } paste = { workspace = true } pin-project = { workspace = true } protobuf = { workspace = true } +pyo3 = { workspace = true, features = ["anyhow"] } quanta = { workspace = true } rustls = { workspace = true } saluki-config = { workspace = true } @@ -47,15 +49,13 @@ slab = { workspace = true } smallvec = { workspace = true } snafu = { workspace = true } stringtheory = { workspace = true } +tempfile = { workspace = true } tokio = { workspace = true, features = ["io-util", "macros", "net", "rt", "rt-multi-thread", "signal", "sync"] } tokio-util = { workspace = true } tower = { workspace = true, features = ["retry", "timeout", "util"] } tracing = { workspace = true } +tracing-test = { workspace = true } url = { workspace = true } -async-walkdir = "1.0.0" -pyo3 = { version = "0.21.2", features = ["anyhow"] } -tracing-test = "0.2.4" -wasmtime = "21.0.1" -wasmtime-wasi = "21.0.1" -tempfile = "3.10.1" +wasmtime = { workspace = true } +wasmtime-wasi = { workspace = true } diff --git a/lib/saluki-components/src/sources/checks/listener.rs b/lib/saluki-components/src/sources/checks/listener.rs index 661ad873..a14ee78a 100644 --- a/lib/saluki-components/src/sources/checks/listener.rs +++ b/lib/saluki-components/src/sources/checks/listener.rs @@ -151,9 +151,10 @@ pub struct DirCheckListenerContext { #[cfg(test)] mod tests { - use super::*; use tokio::io::AsyncWriteExt; + use super::*; + macro_rules! setup_test_dir { ($($file_path:expr => $content:expr),* $(,)?) => {{ let temp_dir = tempfile::tempdir().expect("get tempdir"); diff --git a/lib/saluki-components/src/sources/checks/mod.rs b/lib/saluki-components/src/sources/checks/mod.rs index 60a755d8..2e4cea82 100644 --- a/lib/saluki-components/src/sources/checks/mod.rs +++ b/lib/saluki-components/src/sources/checks/mod.rs @@ -1,3 +1,10 @@ +use std::collections::HashSet; +use std::{ + collections::HashMap, + path::{Path, PathBuf}, +}; +use std::{fmt::Display, time::Duration}; + use async_trait::async_trait; use memory_accounting::{MemoryBounds, MemoryBoundsBuilder}; use metrics::Counter; @@ -19,12 +26,6 @@ use saluki_error::{generic_error, GenericError}; use saluki_event::{metric::*, DataType, Event}; use serde::Deserialize; use snafu::Snafu; -use std::collections::HashSet; -use std::{ - collections::HashMap, - path::{Path, PathBuf}, -}; -use std::{fmt::Display, time::Duration}; use tokio::{select, sync::mpsc}; use tracing::{debug, error, info, trace, warn}; diff --git a/lib/saluki-components/src/sources/checks/python_scheduler.rs b/lib/saluki-components/src/sources/checks/python_scheduler.rs index 70dec61d..ddaae458 100644 --- a/lib/saluki-components/src/sources/checks/python_scheduler.rs +++ b/lib/saluki-components/src/sources/checks/python_scheduler.rs @@ -1,6 +1,3 @@ -use super::python_exposed_modules::aggregator as pyagg; -use super::python_exposed_modules::datadog_agent; -use super::*; use pyo3::prelude::PyAnyMethods; use pyo3::types::PyDict; use pyo3::types::PyList; @@ -8,6 +5,10 @@ use pyo3::types::PyType; use saluki_error::{generic_error, GenericError}; use tracing::trace; +use super::python_exposed_modules::aggregator as pyagg; +use super::python_exposed_modules::datadog_agent; +use super::*; + struct CheckHandle(Py); impl Clone for CheckHandle { @@ -349,9 +350,10 @@ impl CheckScheduler for PythonCheckScheduler { #[cfg(test)] mod tests { + use tokio::sync::mpsc; + use super::super::*; use super::*; - use tokio::sync::mpsc; #[tokio::test] async fn test_new_check_scheduler() {