Skip to content

Commit e890e90

Browse files
chore: fix clippy lints in tests (#10193)
### Description Fixing some lint errors in tests: - Waiting on zombie process - Needless conversion ### Testing Instructions 👀
1 parent bfc50ac commit e890e90

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Diff for: crates/turborepo-cache/src/config.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ mod test {
221221
)]
222222
#[test_case("", Ok(CacheConfig { local: CacheActions { read: false, write: false }, remote: CacheActions { read: false, write: false } }) ; "empty"
223223
)]
224-
#[test_case("local:r,local:w", Err(Error::DuplicateKeys { text: "local:r,local:w".to_string(), key: "local", span: Some(SourceSpan::new(8_usize.into(), 5_usize.into())) }) ; "duplicate local key"
224+
#[test_case("local:r,local:w", Err(Error::DuplicateKeys { text: "local:r,local:w".to_string(), key: "local", span: Some(SourceSpan::new(8_usize.into(), 5_usize)) }) ; "duplicate local key"
225225
)]
226-
#[test_case("local:rr", Err(Error::DuplicateActions { text: "local:rr".to_string(), action: "r (read)", span: Some(SourceSpan::new(6_usize.into(), 5_usize.into())) }) ; "duplicate action")]
227-
#[test_case("remote:r,local=rx", Err(Error::InvalidCacheTypeAndAction { text: "remote:r,local=rx".to_string(), pair: "local=rx".to_string(), span: Some(SourceSpan::new(9_usize.into(), 8_usize.into())) }) ; "invalid key action pair")]
228-
#[test_case("local:rx", Err(Error::InvalidCacheAction { c: 'x', text: "local:rx".to_string(), span: Some(SourceSpan::new(6_usize.into(), 5_usize.into())) }) ; "invalid action")]
229-
#[test_case("file:r", Err(Error::InvalidCacheType { s: "file".to_string(), text: "file:r".to_string(), span: Some(SourceSpan::new(0_usize.into(), 4_usize.into())) }) ; "invalid cache type")]
226+
#[test_case("local:rr", Err(Error::DuplicateActions { text: "local:rr".to_string(), action: "r (read)", span: Some(SourceSpan::new(6_usize.into(), 5_usize)) }) ; "duplicate action")]
227+
#[test_case("remote:r,local=rx", Err(Error::InvalidCacheTypeAndAction { text: "remote:r,local=rx".to_string(), pair: "local=rx".to_string(), span: Some(SourceSpan::new(9_usize.into(), 8_usize)) }) ; "invalid key action pair")]
228+
#[test_case("local:rx", Err(Error::InvalidCacheAction { c: 'x', text: "local:rx".to_string(), span: Some(SourceSpan::new(6_usize.into(), 5_usize)) }) ; "invalid action")]
229+
#[test_case("file:r", Err(Error::InvalidCacheType { s: "file".to_string(), text: "file:r".to_string(), span: Some(SourceSpan::new(0_usize.into(), 4_usize)) }) ; "invalid cache type")]
230230
fn test_cache_config(s: &str, expected: Result<CacheConfig, Error>) {
231231
assert_eq!(CacheConfig::from_str(s), expected);
232232
}

Diff for: crates/turborepo-lib/src/daemon/endpoint.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ mod test {
241241
panic!("expected an error")
242242
}
243243

244-
child.kill().unwrap();
244+
let _ = child.kill();
245+
// Make sure to wait on the child to not leave a zombie process
246+
let _ = child.wait();
245247
}
246248
}

0 commit comments

Comments
 (0)