Skip to content

Commit 3b59dcc

Browse files
authored
Merge pull request #504 from stakpak/fix/windows-executor-tests
fix: skip shell script tests on Windows
2 parents 17aba71 + a318d8d commit 3b59dcc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cli/src/commands/daemon/executor.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,18 @@ pub async fn run_check_script(
184184
#[cfg(test)]
185185
mod tests {
186186
use super::*;
187+
#[cfg(unix)]
187188
use std::fs::{self, File};
189+
#[cfg(unix)]
188190
use std::io::Write;
191+
#[cfg(unix)]
189192
use tempfile::tempdir;
190193

191194
#[cfg(unix)]
192195
use std::os::unix::fs::PermissionsExt;
193196

194197
/// Create a test script that exits with the given code.
198+
#[cfg(unix)]
195199
fn create_script(dir: &Path, name: &str, content: &str) -> std::path::PathBuf {
196200
let script_path = dir.join(name);
197201
let mut file = File::create(&script_path).expect("Failed to create script");
@@ -210,6 +214,7 @@ mod tests {
210214
script_path
211215
}
212216

217+
#[cfg(unix)]
213218
#[tokio::test]
214219
async fn test_script_exit_0() {
215220
let dir = tempdir().expect("Failed to create temp dir");
@@ -231,6 +236,7 @@ mod tests {
231236
assert!(result.stdout.contains("context data"));
232237
}
233238

239+
#[cfg(unix)]
234240
#[tokio::test]
235241
async fn test_script_exit_1() {
236242
let dir = tempdir().expect("Failed to create temp dir");
@@ -251,6 +257,7 @@ mod tests {
251257
assert!(!result.timed_out);
252258
}
253259

260+
#[cfg(unix)]
254261
#[tokio::test]
255262
async fn test_script_exit_2() {
256263
let dir = tempdir().expect("Failed to create temp dir");
@@ -271,6 +278,7 @@ mod tests {
271278
assert!(!result.timed_out);
272279
}
273280

281+
#[cfg(unix)]
274282
#[tokio::test]
275283
async fn test_script_timeout() {
276284
let dir = tempdir().expect("Failed to create temp dir");
@@ -285,6 +293,7 @@ mod tests {
285293
assert!(result.exit_code.is_none());
286294
}
287295

296+
#[cfg(unix)]
288297
#[tokio::test]
289298
async fn test_capture_stderr() {
290299
let dir = tempdir().expect("Failed to create temp dir");
@@ -302,6 +311,7 @@ mod tests {
302311
assert!(result.stderr.contains("stderr message"));
303312
}
304313

314+
#[cfg(unix)]
305315
#[tokio::test]
306316
async fn test_missing_script() {
307317
let result =
@@ -340,6 +350,7 @@ mod tests {
340350
));
341351
}
342352

353+
#[cfg(unix)]
343354
#[tokio::test]
344355
async fn test_large_output() {
345356
let dir = tempdir().expect("Failed to create temp dir");

0 commit comments

Comments
 (0)