tests: add test suite implemented as a Python program

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-01-10 17:38:05 +02:00
parent ccf794d2a0
commit ba301ead4e
3 changed files with 343 additions and 6 deletions
+3 -5
View File
@@ -448,14 +448,12 @@ impl RunInfoBuilder {
Ok(RunInfo {
repo: self.repo.map(|x| x.to_string()).unwrap_or("".into()),
commit: self.commit.map(|x| x.to_string()).unwrap_or("".into()),
id: self.id.ok_or(NativeError::MissingInfo("id".into()))?,
id: self.id.unwrap_or("<unknown>".into()),
result: self
.result
.ok_or(NativeError::MissingInfo("result".into()))?,
log: self.log.ok_or(NativeError::MissingInfo("log".into()))?,
run_info: self
.run_info
.ok_or(NativeError::MissingInfo("run_info".into()))?,
log: self.log.unwrap_or("<unknown>".into()),
run_info: self.run_info.unwrap_or("<unknown>".into()),
timestamp: now,
})
}
+1 -1
View File
@@ -11,7 +11,7 @@ use crate::{LogFile, RunInfo};
const CSS: &str = include_str!("native-ci.css");
pub fn build_report(log: &mut LogFile, state: &Path) -> Result<(), ReportError> {
pub fn build_report(_log: &mut LogFile, state: &Path) -> Result<(), ReportError> {
let mut run_infos = collect_run_infos(state)?;
run_infos.sort_by(|a, b| a.timestamp.partial_cmp(&b.timestamp).unwrap());