diff --git a/updatehub/Cargo.toml b/updatehub/Cargo.toml index c942e92e..8548d9a3 100644 --- a/updatehub/Cargo.toml +++ b/updatehub/Cargo.toml @@ -16,7 +16,7 @@ publish = false repository = "https://github.com/UpdateHub/updatehub.git" [features] -default = ["test-env"] +default = [] # Feature to allow deserialization from v1 Settings v1-parsing = ["serde_ini"] @@ -35,6 +35,20 @@ path = "src/setup_mock_env.rs" test = true required-features = ["test-env"] +# The integration tests drive the agent against a mock server, so they need the +# `updatehub::tests` helpers and `mockito`, both of which live behind `test-env`. +[[test]] +name = "common" +required-features = ["test-env"] + +[[test]] +name = "successful_integration_test" +required-features = ["test-env"] + +[[test]] +name = "failed_integration_test" +required-features = ["test-env"] + [dependencies] argh = "0.1.3" async-ctrlc = { version = "1", optional = true } diff --git a/updatehub/src/firmware/mod.rs b/updatehub/src/firmware/mod.rs index d30d1b54..625827df 100644 --- a/updatehub/src/firmware/mod.rs +++ b/updatehub/src/firmware/mod.rs @@ -5,7 +5,7 @@ mod hook; pub mod installation_set; -#[cfg(feature = "test-env")] +#[cfg(any(test, feature = "test-env"))] pub mod tests; use self::hook::{run_hook, run_hooks_from_dir}; diff --git a/updatehub/src/lib.rs b/updatehub/src/lib.rs index d94dfd94..420ccf3f 100644 --- a/updatehub/src/lib.rs +++ b/updatehub/src/lib.rs @@ -17,7 +17,7 @@ mod utils; #[cfg(test)] mod cloud_mock; -#[cfg(feature = "test-env")] +#[cfg(any(test, feature = "test-env"))] pub mod tests; #[cfg(test)]