summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-12 15:54:42 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-15 14:38:00 +0200
commit9225ef0d3119967a042ac147243739ea130f0c19 (patch)
tree30b5e78a5e6596185f231f0b1fc1cd8e815b5454
parent8be0bbd59de82e55573e3cf48e7eeae669dc93b3 (diff)
downloadradicle-native-ci-9225ef0d3119967a042ac147243739ea130f0c19.tar.gz
pass in RunLog, not filename for it
RunLog knows how to construct a whole log, rather than just writing individual messages to it. Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rw-r--r--src/bin/radicle-native-ci.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bin/radicle-native-ci.rs b/src/bin/radicle-native-ci.rs
index 3c91c1b..1975912 100644
--- a/src/bin/radicle-native-ci.rs
+++ b/src/bin/radicle-native-ci.rs
@@ -243,7 +243,7 @@ struct RunnerBuilder<'a> {
commit: Option<Oid>,
src: Option<PathBuf>,
log: Option<&'a mut LogFile>,
- run_log: Option<PathBuf>,
+ run_log: Option<RunLog>,
timeout: Option<usize>,
builder: Option<&'a mut RunInfoBuilder>,
}
@@ -279,8 +279,8 @@ impl<'a> RunnerBuilder<'a> {
self
}
- fn run_log(mut self, path: &Path) -> Self {
- self.run_log = Some(path.into());
+ fn run_log(mut self, run_log: RunLog) -> Self {
+ self.run_log = Some(run_log);
self
}
@@ -295,8 +295,6 @@ impl<'a> RunnerBuilder<'a> {
}
fn build(self) -> Result<Runner<'a>, NativeError> {
- let run_log = self.run_log.ok_or(NativeError::Unset("run_log"))?;
- let run_log = RunLog::new(&run_log);
Ok(Runner {
run_id: self.run_id.ok_or(NativeError::Unset("run_id"))?,
storage: self.storage.ok_or(NativeError::Unset("storage"))?,
@@ -304,7 +302,7 @@ impl<'a> RunnerBuilder<'a> {
commit: self.commit.ok_or(NativeError::Unset("commit"))?,
src: self.src.ok_or(NativeError::Unset("src"))?,
log: self.log.ok_or(NativeError::Unset("log"))?,
- run_log,
+ run_log: self.run_log.ok_or(NativeError::Unset("run_log"))?,
timeout: self.timeout,
builder: self.builder.ok_or(NativeError::Unset("builder"))?,
})