diff --git a/crates/spfs/src/bootstrap_test.rs b/crates/spfs/src/bootstrap_test.rs index a039d9d77..e9d96004f 100644 --- a/crates/spfs/src/bootstrap_test.rs +++ b/crates/spfs/src/bootstrap_test.rs @@ -75,11 +75,13 @@ async fn test_shell_initialization_startup_scripts( std::env::set_var("SHELL", &shell_path); match crate::Shell::find_best(None).unwrap() { + #[cfg(unix)] crate::Shell::Bash(_) if shell == "tcsh" => { // Test will fail because we weren't able to // find the shell we are trying to test return; } + #[cfg(unix)] crate::Shell::Tcsh(_) if shell == "bash" => { // Test will fail because we weren't able to // find the shell we are trying to test diff --git a/crates/spfs/src/runtime/storage_test.rs b/crates/spfs/src/runtime/storage_test.rs index 2693950fe..c50781216 100644 --- a/crates/spfs/src/runtime/storage_test.rs +++ b/crates/spfs/src/runtime/storage_test.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // https://github.com/spkenv/spk +#[cfg(unix)] use std::os::unix::fs::PermissionsExt; use futures::TryStreamExt; @@ -583,6 +584,7 @@ async fn test_runtime_ensure_extra_bind_mount_locations_exist(tmpdir: tempfile:: assert!(runtime.prepare_live_layers().await.is_ok()) } +#[cfg(unix)] #[rstest] fn test_makedirs_dont_change_existing(tmpdir: tempfile::TempDir) { let chkdir = tmpdir.path().join("my_dir"); diff --git a/crates/spfs/src/storage/repository_test.rs b/crates/spfs/src/storage/repository_test.rs index 33d24c74b..2a0c9add5 100644 --- a/crates/spfs/src/storage/repository_test.rs +++ b/crates/spfs/src/storage/repository_test.rs @@ -4,7 +4,9 @@ use std::collections::HashSet; use std::iter::FromIterator; +#[cfg(unix)] use std::os::unix::fs::{MetadataExt, PermissionsExt}; +#[cfg(unix)] use std::sync::Arc; use rstest::rstest; @@ -12,6 +14,7 @@ use rstest::rstest; use super::Ref; use crate::encoding::prelude::*; use crate::fixtures::*; +#[cfg(unix)] use crate::storage::fs; use crate::storage::prelude::*; use crate::tracking::TagSpec; @@ -58,6 +61,7 @@ async fn test_find_aliases( assert_eq!(actual, expected); } +#[cfg(unix)] #[rstest] #[tokio::test] async fn test_commit_mode_fs(tmpdir: tempfile::TempDir) { @@ -109,6 +113,7 @@ async fn test_commit_mode_fs(tmpdir: tempfile::TempDir) { ) } +#[cfg(unix)] #[rstest] #[case::fs(tmprepo("fs"))] #[case::tar(tmprepo("tar"))] diff --git a/crates/spfs/src/storage/tag_test.rs b/crates/spfs/src/storage/tag_test.rs index df96af8de..b4a112efe 100644 --- a/crates/spfs/src/storage/tag_test.rs +++ b/crates/spfs/src/storage/tag_test.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // https://github.com/spkenv/spk +#[cfg(unix)] use std::os::unix::fs::MetadataExt; use chrono::prelude::*; @@ -107,6 +108,7 @@ async fn test_tag_no_duplication( ); } +#[cfg(unix)] #[rstest] #[tokio::test] async fn test_tag_permissions(tmpdir: tempfile::TempDir) {