2021-08-17 16:19:22 +00:00
|
|
|
use assert_cmd::Command;
|
|
|
|
use predicates::prelude::*;
|
|
|
|
use std::time::Duration;
|
|
|
|
|
2021-09-17 20:20:42 +00:00
|
|
|
#[ignore]
|
2021-08-17 16:19:22 +00:00
|
|
|
#[tokio::test]
|
|
|
|
async fn test_logging() {
|
|
|
|
Command::cargo_bin("influxdb_iox")
|
|
|
|
.unwrap()
|
2021-09-09 15:49:14 +00:00
|
|
|
.args(&[
|
|
|
|
"run",
|
|
|
|
"--log-filter",
|
|
|
|
"info",
|
|
|
|
"--api-bind",
|
|
|
|
"127.0.0.1:0",
|
|
|
|
"--grpc-bind",
|
|
|
|
"127.0.0.1:0",
|
|
|
|
])
|
2021-08-17 16:19:22 +00:00
|
|
|
.timeout(Duration::from_secs(1))
|
|
|
|
.assert()
|
|
|
|
.failure()
|
|
|
|
// Tokio-trace output
|
|
|
|
.stdout(predicate::str::contains("InfluxDB IOx server starting"))
|
|
|
|
// log crate output
|
|
|
|
.stdout(predicate::str::contains("InfluxDB IOx server ready"));
|
|
|
|
|
|
|
|
Command::cargo_bin("influxdb_iox")
|
|
|
|
.unwrap()
|
2021-09-09 15:49:14 +00:00
|
|
|
.args(&[
|
|
|
|
"run",
|
|
|
|
"--log-filter",
|
|
|
|
"error",
|
|
|
|
"--api-bind",
|
|
|
|
"127.0.0.1:0",
|
|
|
|
"--grpc-bind",
|
|
|
|
"127.0.0.1:0",
|
|
|
|
])
|
2021-08-17 16:19:22 +00:00
|
|
|
.timeout(Duration::from_secs(1))
|
|
|
|
.assert()
|
|
|
|
.failure()
|
|
|
|
// Tokio-trace output
|
|
|
|
.stdout(predicate::str::contains("InfluxDB IOx server starting").not())
|
|
|
|
// log crate output
|
|
|
|
.stdout(predicate::str::contains("InfluxDB IOx server ready").not());
|
|
|
|
}
|