Simplistic way of collecting logs of containers used in the test, mostly to debug build failures on CI.
(&self)
| 118 | /// Simplistic way of collecting logs of containers used in the test, |
| 119 | /// mostly to debug build failures on CI. |
| 120 | pub async fn logs(&self) -> Vec<String> { |
| 121 | let mut log_stream = self.docker.logs::<&str>( |
| 122 | &self.container.name, |
| 123 | Some(LogsOptions { |
| 124 | stdout: true, |
| 125 | stderr: true, |
| 126 | follow: false, |
| 127 | ..Default::default() |
| 128 | }), |
| 129 | ); |
| 130 | |
| 131 | let mut out = Vec::new(); |
| 132 | while let Some(Ok(log)) = log_stream.next().await { |
| 133 | out.push(log.to_string().trim().to_string()); |
| 134 | } |
| 135 | out |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | impl Drop for DockerContainer { |
no test coverage detected