Radish alpha
r
rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE
Radicle CI adapter for native CI
Radicle
Git
log run infos found for report generation
Lars Wirzenius committed 2 years ago
commit 04d69af3f5adf21f0173cd1d2f901a1e49a4ad8f
parent 12b06b1
3 files changed +9 -5
modified src/main.rs
@@ -68,7 +68,7 @@ fn fallible_main() -> Result<(), NativeError> {
        "update report page in {}\n",
        config.state.display()
    ))?;
-
    report::build_report(&config.state)?;
+
    report::build_report(&mut logfile, &config.state)?;
    logfile.write(format!("radicle-native-ci ends: {:?}\n", result))?;
    result
}
@@ -379,7 +379,7 @@ pub struct RunInfo {
    log: PathBuf,

    /// Name of run info file.
-
    run_info: PathBuf,
+
    pub run_info: PathBuf,

    /// Timestamp of when the run ended (the value was created).
    /// ISO8601 format.
modified src/report.rs
@@ -7,13 +7,17 @@ use html_page::{Document, Element, Tag};
use radicle_ci_broker::msg::RunResult;
use walkdir::WalkDir;

-
use crate::RunInfo;
+
use crate::{LogFile, RunInfo};

const CSS: &str = include_str!("native-ci.css");

-
pub fn build_report(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());
+
    for ri in run_infos.iter() {
+
        log.write(format!("found run info {}\n", ri.run_info.display()))
+
            .unwrap();
+
    }

    let repos = repositories(&run_infos);
    let doc = list_runs(&repos, &run_infos);
modified test.sh
@@ -38,7 +38,7 @@ export RADICLE_NATIVE_CI_LOG=debug

python3 test.py --commit b3a9a809420c89d08460046683f33d8a5bdfdc0a >"$tmp/test-request.yaml"
expect_failure
-
find "$tmp/test.state" -type f | grep -vF /.git/
+
# find "$tmp/test.state" -type f | grep -vF /.git/

# cat "$tmp/test.state/index.html"