Skip to content

Commit

Permalink
Ignore mac potatoes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jul 25, 2024
1 parent 0acb07e commit 081a43f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -314,7 +308,7 @@ where
}
}
recv(trx) -> _ => {
anyhow::bail!("Timed out after {timeout:?}");
anyhow::bail!("Timed out after {TIMEOUT:?}");
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions tests/bans_build.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -131,6 +147,8 @@ build-script = "00abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef00
/// skipped
#[test]
fn skips_matching_build_scripts() {
fucking_macs!();

let diags = gather_bans(
func_name!(),
KrateGather {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 081a43f

Please sign in to comment.