diff --git a/src/test_utils.rs b/src/test_utils.rs index e350bfd3..19a76506 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -294,15 +294,9 @@ where || { let mut diagnostics = Vec::new(); - // Macs, simply the worst - let secs = if std::env::var_os("CI").is_some() && cfg!(target_os = "macos") { - 30 - } else { - 10 - }; + const TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10); - let timeout = std::time::Duration::from_secs(secs); - let trx = crossbeam::channel::after(timeout); + let trx = crossbeam::channel::after(TIMEOUT); loop { crossbeam::select! { recv(rx) -> msg => { @@ -314,7 +308,7 @@ where } } recv(trx) -> _ => { - anyhow::bail!("Timed out after {timeout:?}"); + anyhow::bail!("Timed out after {TIMEOUT:?}"); } } } diff --git a/tests/bans_build.rs b/tests/bans_build.rs index 1cf767d8..b0835c37 100644 --- a/tests/bans_build.rs +++ b/tests/bans_build.rs @@ -1,8 +1,20 @@ use cargo_deny::{field_eq, func_name, test_utils::*}; +macro_rules! fucking_macs { + () => { + #[allow(clippy::disallowed_macros)] + if std::env::var_os("CI").is_some() && cfg!(target_os = "macos") { + eprintln!("potato CI platform detected, ignoring test"); + return; + } + }; +} + /// Verifies we can detect and error on builtin globs #[test] fn detects_scripts_by_builtin_glob() { + fucking_macs!(); + let mut diags = gather_bans( func_name!(), KrateGather { @@ -52,6 +64,8 @@ fn detects_scripts_by_user_extension() { /// Verifies we detect and error on scripts detected by shebang #[test] fn detects_scripts_by_shebang() { + fucking_macs!(); + let mut diags = gather_bans( func_name!(), KrateGather { @@ -101,6 +115,8 @@ include-dependencies = true /// Verifies user provided builscript checksums are always validated correctly #[test] fn detects_build_script_mismatch() { + fucking_macs!(); + let mut diags = gather_bans( func_name!(), KrateGather { @@ -131,6 +147,8 @@ build-script = "00abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef00 /// skipped #[test] fn skips_matching_build_scripts() { + fucking_macs!(); + let diags = gather_bans( func_name!(), KrateGather { @@ -190,6 +208,8 @@ build-script = "1a850d791184374f614d01c86c8d6c9ba0500e64cb746edc9720ceaaa1cd8eaf /// Verifies executables are allowed by glob patterns #[test] fn allows_by_glob() { + fucking_macs!(); + let diags = gather_bans( func_name!(), KrateGather { @@ -221,6 +241,8 @@ allow-globs = [ /// Verifies executables are allowed by path/checksum #[test] fn allows_by_path() { + fucking_macs!(); + let mut diags = gather_bans( func_name!(), KrateGather {