From e6904e990fdae64810e6b6ddb894763fabdc03f2 Mon Sep 17 00:00:00 2001 From: tyranron Date: Wed, 15 Jan 2025 21:31:11 +0200 Subject: [PATCH] Make linter happy for integration tests --- Cargo.toml | 2 +- src/lib.rs | 10 ++++++---- src/platform/dart/utils/callback.rs | 6 +++++- src/platform/dart/utils/dart_future.rs | 6 +++++- tests/rpc/mod.rs | 4 ++-- tests/web.rs | 1 + 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 68aa6cca..e3ac1623 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ members = [ crate-type = ["cdylib", "rlib", "staticlib"] [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ["cfg(frb_expand)"] } +unexpected_cfgs = { level = "warn", check-cfg = ["cfg(disabled)", "cfg(frb_expand)"] } [profile.release] lto = "fat" diff --git a/src/lib.rs b/src/lib.rs index 37126bf9..ad106931 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,10 +149,6 @@ unused_results, variant_size_differences )] -#![cfg_attr( - feature = "mockable", - expect(missing_docs, reason = "for testing only") -)] // TODO: Needs refactoring. #![expect( clippy::module_name_repetitions, @@ -171,3 +167,9 @@ pub mod peer; pub mod platform; pub mod room; pub mod rpc; + +#[cfg(all(test, target_family = "wasm"))] +mod used_in_integration_tests_only { + use instant as _; + use wasm_bindgen_test as _; +} diff --git a/src/platform/dart/utils/callback.rs b/src/platform/dart/utils/callback.rs index 2fd803de..d4f105a6 100644 --- a/src/platform/dart/utils/callback.rs +++ b/src/platform/dart/utils/callback.rs @@ -232,7 +232,11 @@ extern "C" fn callback_finalizer(_: *mut c_void, cb: *mut c_void) { #[cfg(feature = "mockable")] pub mod tests { - #![expect(clippy::missing_safety_doc, reason = "only for testing")] + #![expect( // for testing only + clippy::missing_safety_doc, + missing_docs, + reason = "for testing only" + )] use std::cell::RefCell; diff --git a/src/platform/dart/utils/dart_future.rs b/src/platform/dart/utils/dart_future.rs index eafdc2eb..02477577 100644 --- a/src/platform/dart/utils/dart_future.rs +++ b/src/platform/dart/utils/dart_future.rs @@ -206,7 +206,11 @@ where #[cfg(feature = "mockable")] pub mod tests { - #![expect(clippy::missing_safety_doc, reason = "for testing only")] + #![expect( // for testing only + clippy::missing_safety_doc, + missing_docs, + reason = "for testing only" + )] use std::cell::RefCell; diff --git a/tests/rpc/mod.rs b/tests/rpc/mod.rs index 0e8f1060..93d646c7 100644 --- a/tests/rpc/mod.rs +++ b/tests/rpc/mod.rs @@ -716,8 +716,8 @@ mod on_connection_loss { } /// Tests for the [`RpcClient::on_reconnected`] function. -// TODO: this tests should be implemented for the RpcSession! -#[cfg(feature = "disabled")] +// TODO: This tests should be implemented for the `RpcSession`! +#[cfg(disabled)] mod on_reconnected { use medea_reactive::ObservableCell; diff --git a/tests/web.rs b/tests/web.rs index 55559da3..109b9325 100644 --- a/tests/web.rs +++ b/tests/web.rs @@ -332,6 +332,7 @@ async fn wait_and_check_test_result( }; } +#[expect(dead_code, reason = "preserved for future tests")] async fn get_video_track() -> api::RemoteMediaTrack { let manager = MediaManager::default(); let mut settings = MediaStreamSettings::new();