-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agent: Change base path of testlogs from outputPath to BINDIR (#1230)
- Loading branch information
Showing
7 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pub mod upload; | ||
pub mod upload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod artifact; | ||
pub mod artifact; | ||
pub mod utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use std::path::{Path, PathBuf}; | ||
|
||
/// Splits [`Path`] into two parts separated by `target`. The `target` itself is included | ||
/// in the end of first part. | ||
/// | ||
/// ``` | ||
/// # use std::path::Path; | ||
/// # use bazelci_agent::utils::split_path_inclusive; | ||
/// | ||
/// let path = Path::new("a/b/c"); | ||
/// let (first, second) = split_path_inclusive(path, "b").unwrap(); | ||
/// assert_eq!(first, Path::new("a/b")); | ||
/// assert_eq!(second, Path::new("c")); | ||
/// ``` | ||
/// | ||
pub fn split_path_inclusive(path: &Path, target: &str) -> Option<(PathBuf, PathBuf)> { | ||
let mut iter = path.iter(); | ||
|
||
let mut first = PathBuf::new(); | ||
let mut found = false; | ||
while let Some(comp) = iter.next() { | ||
first.push(Path::new(comp)); | ||
if comp == target { | ||
found = true; | ||
break; | ||
} | ||
} | ||
|
||
if found { | ||
let second: PathBuf = iter.collect(); | ||
Some((first, second)) | ||
} else { | ||
None | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mod upload; | ||
mod upload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mod artifact; | ||
mod artifact; |