Skip to content

Commit 3bdf081

Browse files
committed
fix ci bug
1 parent c53639c commit 3bdf081

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

e2e/src/tests/common.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,22 @@ use std::process::Command;
33

44
#[allow(dead_code)]
55
pub fn workspace_root() -> PathBuf {
6-
checked_in_runtime_root()
6+
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
7+
.ancestors()
8+
.find(|path| {
9+
let manifest_path = path.join("Cargo.toml");
10+
manifest_path.is_file()
11+
&& std::fs::read_to_string(&manifest_path)
12+
.map(|contents| {
13+
contents.contains("[workspace]") && contents.contains("members")
14+
})
15+
.unwrap_or(false)
16+
})
17+
.map(std::path::Path::to_path_buf)
18+
.expect("failed to locate workspace root containing Cargo workspace manifest")
719
}
820

21+
#[allow(dead_code)]
922
pub fn checked_in_runtime_root() -> PathBuf {
1023
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
1124
.ancestors()

0 commit comments

Comments
 (0)