diff --git a/src/tests/all.rs b/src/tests/all.rs index eca833ff45a..d3bf22c5ee1 100644 --- a/src/tests/all.rs +++ b/src/tests/all.rs @@ -7,6 +7,8 @@ extern crate diesel; #[macro_use] extern crate lazy_static; #[macro_use] +extern crate log; +#[macro_use] extern crate serde; #[macro_use] extern crate serde_json; diff --git a/src/tests/record.rs b/src/tests/record.rs index c1d34bea226..b822fecb57c 100644 --- a/src/tests/record.rs +++ b/src/tests/record.rs @@ -292,6 +292,7 @@ fn replay_http( ) -> impl Future, Error>> + Send { static IGNORED_HEADERS: &[&str] = &["authorization", "date", "cache-control"]; + debug!("<- {:?}", req); assert_eq!(req.uri().to_string(), exchange.request.uri); assert_eq!(req.method().to_string(), exchange.request.method); assert_ok!(writeln!( @@ -337,6 +338,7 @@ fn replay_http( let status = StatusCode::from_u16(exchange.response.status).unwrap(); let response = builder.status(status).body(body.into()).unwrap(); + debug!("-> {:?}", response); Ok(response) } } diff --git a/src/tests/util.rs b/src/tests/util.rs index 14330206492..575c8371052 100644 --- a/src/tests/util.rs +++ b/src/tests/util.rs @@ -47,6 +47,13 @@ use url::Url; pub use conduit::{header, StatusCode}; +pub fn init_logger() { + let _ = env_logger::builder() + .format_timestamp(None) + .is_test(true) + .try_init(); +} + struct TestAppInner { app: Arc, // The bomb (if created) needs to be held in scope until the end of the test. @@ -92,6 +99,8 @@ pub struct TestApp(Rc); impl TestApp { /// Initialize an application with an `Uploader` that panics pub fn init() -> TestAppBuilder { + init_logger(); + TestAppBuilder { config: crate::simple_config(), proxy: None,