From 19effc86d077090db99ca83bf9f98a14f9d4a9c6 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Thu, 30 Nov 2023 15:21:28 -0500 Subject: [PATCH] print whole error chain --- tests/ci_test.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/ci_test.rs b/tests/ci_test.rs index 18e270f..1017765 100644 --- a/tests/ci_test.rs +++ b/tests/ci_test.rs @@ -13,9 +13,11 @@ async fn ci() -> eyre::Result<()> { results.push(repo(&api).await.wrap_err("repo error")); let mut errors = 0; - for res in results.into_iter().filter_map(Result::err) { + for report in results.into_iter().filter_map(Result::err) { errors += 1; - println!("{res}"); + for (i, err) in report.chain().enumerate() { + println!("{i}. {err}"); + } } if errors > 0 { eyre::bail!("test failed"); @@ -83,7 +85,7 @@ async fn repo(api: &forgejo_api::Forgejo) -> eyre::Result<()> { let mut push_options = git2::PushOptions::new(); push_options.remote_callbacks(callbacks); let mut origin = local_repo.remote("origin", remote_repo.clone_url.as_str())?; - origin.push(&[branch_ref_name], Some(&mut push_options))?; + origin.push(&[dbg!(branch_ref_name)], Some(&mut push_options))?; tokio::fs::write("/test_repo/example.rs", "fn add_one(x: u32) -> u32 { x + 1 }").await?; let mut index = local_repo.index()?; @@ -102,7 +104,7 @@ async fn repo(api: &forgejo_api::Forgejo) -> eyre::Result<()> { }); let mut push_options = git2::PushOptions::new(); push_options.remote_callbacks(callbacks); - origin.push(&[branch_ref_name], Some(&mut push_options)).wrap_err("failed to push branch")?; + origin.push(&[dbg!(branch_ref_name)], Some(&mut push_options)).wrap_err("failed to push branch")?; let pr_opt = forgejo_api::CreatePullRequestOption { assignee: None,