Skip to content

Commit

Permalink
Fixed tests crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Oct 16, 2024
1 parent 1e235b5 commit 56a69ac
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
3 changes: 2 additions & 1 deletion mirrord/agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ fn main() {
}

#[cfg(all(target_os = "linux", test))]
mod crates_used_in_integration_tests {
mod deps_used_in_integration_tests {
//! To silence false positive from `unused_crate_dependencies`.
//!
//! See [discussion on GitHub](https://github.com/rust-lang/cargo/issues/12717#issuecomment-1728123462) for reference.
use test_bin as _;
Expand Down
3 changes: 2 additions & 1 deletion mirrord/auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ pub mod error;
/// Public/Private key abstraction for serialization and deserialization
pub mod key_pair;

mod unused_dependencies_false_positives {
mod deps_required_for_compilation {
//! To silence false positive from `unused_crate_dependencies`.
//!
//! See [discussion on GitHub](https://github.com/rust-lang/cargo/issues/12717#issuecomment-1728123462) for reference.
#[cfg(test)]
Expand Down
3 changes: 2 additions & 1 deletion mirrord/console/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ pub use async_logger::init_async_logger;
pub use logger::init_logger;

#[cfg(feature = "binary")]
mod crates_used_in_binary {
mod deps_used_in_binary {
//! To silence false positive from `unused_crate_dependencies`.
//!
//! See [discussion on GitHub](https://github.com/rust-lang/cargo/issues/12717#issuecomment-1728123462) for reference.
use tracing as _;
Expand Down
3 changes: 2 additions & 1 deletion mirrord/layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,9 @@ pub(crate) unsafe extern "C" fn uv_fs_close_detour(
}

#[cfg(test)]
mod crates_used_in_integration_tests {
mod deps_used_in_integration_tests {
//! To silence false positive from `unused_crate_dependencies`.
//!
//! See [discussion on GitHub](https://github.com/rust-lang/cargo/issues/12717#issuecomment-1728123462) for reference.
use actix_codec as _;
Expand Down
17 changes: 17 additions & 0 deletions tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,20 @@ mod targetless;
mod traffic;

pub mod utils;

#[cfg(test)]
mod deps_used_conditionally {
//! To silence false positive from `unused_crate_dependencies`.
//!
//! These dependencies are used only when `operator` feature is enabled for this crate.
//! However, dev dependencies cannot be optional.
use aws_config as _;
use aws_credential_types as _;
use aws_sdk_sqs as _;
use aws_types as _;
use json_patch as _;
use jsonptr as _;
use mirrord_operator as _;
use regex as _;
}

0 comments on commit 56a69ac

Please sign in to comment.