Skip to content

Commit 8af4271

Browse files
cgwaltersjmarrero
authored andcommitted
tests: Ignore baseimage root test if CARGO_MANIFEST_PATH is not set
This is only in relatively new Rust (not in RHEL 9.5). Signed-off-by: Colin Walters <walters@verbum.org> Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
1 parent 211598a commit 8af4271

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/lints.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ mod tests {
297297
assert!(check_baseimage_root(&td).is_err());
298298

299299
// Copy our reference base image content from the source dir
300-
let manifest = std::env::var_os("CARGO_MANIFEST_PATH").unwrap();
300+
let Some(manifest) = std::env::var_os("CARGO_MANIFEST_PATH") else {
301+
// This was only added in relatively recent cargo
302+
return Ok(());
303+
};
301304
let srcdir = Path::new(&manifest)
302305
.parent()
303306
.unwrap()

0 commit comments

Comments
 (0)