From f3dd24bb3c12c014cedabcea1144951d7a6e3b59 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Fri, 17 Jul 2020 15:19:00 -0700 Subject: [PATCH] bug cleanup related to error handling (#552) * cleanup error handling fixes --- zebra-state/tests/basic.rs | 3 +++ zebra-test/src/lib.rs | 42 +++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/zebra-state/tests/basic.rs b/zebra-state/tests/basic.rs index d3deedda..76885d93 100644 --- a/zebra-state/tests/basic.rs +++ b/zebra-state/tests/basic.rs @@ -49,12 +49,14 @@ static GET_TIP_TRANSCRIPT: Lazy> = Lazy::new(|| { }); #[tokio::test] +#[spandoc::spandoc] async fn check_transcripts() -> Result<(), Report> { zebra_test::init(); for transcript_data in &[&ADD_BLOCK_TRANSCRIPT, &GET_TIP_TRANSCRIPT] { let service = in_memory::init(); let transcript = Transcript::from(transcript_data.iter().cloned()); + /// SPANDOC: check the in memory service against the transcript transcript.check(service).await?; let storage_guard = TempDir::new("")?; @@ -62,6 +64,7 @@ async fn check_transcripts() -> Result<(), Report> { path: storage_guard.path().to_owned(), }); let transcript = Transcript::from(transcript_data.iter().cloned()); + /// SPANDOC: check the on disk service against the transcript transcript.check(service).await?; // Delete the contents of the temp directory before going to the next case. std::mem::drop(storage_guard); diff --git a/zebra-test/src/lib.rs b/zebra-test/src/lib.rs index b35ce342..7fae65a3 100644 --- a/zebra-test/src/lib.rs +++ b/zebra-test/src/lib.rs @@ -20,7 +20,47 @@ pub fn init() { .with(ErrorLayer::default()) .init(); - color_eyre::install().unwrap(); + color_eyre::config::HookBuilder::default() + .add_frame_filter(Box::new(|frames| { + let mut displayed = std::collections::HashSet::new(); + let filters = &[ + "tokio::", + "