57 lines
1.4 KiB
Rust
57 lines
1.4 KiB
Rust
use assert_cmd::Command;
|
|
use predicates::prelude::*;
|
|
|
|
use crate::common::server_fixture::DEFAULT_SERVER_ID;
|
|
|
|
use super::scenario::{fixture_broken_catalog, rand_name};
|
|
|
|
#[tokio::test]
|
|
async fn test_dump_catalog() {
|
|
let db_name = rand_name();
|
|
let fixture = fixture_broken_catalog(&db_name).await;
|
|
|
|
Command::cargo_bin("influxdb_iox")
|
|
.unwrap()
|
|
.arg("debug")
|
|
.arg("dump-catalog")
|
|
.arg("--object-store")
|
|
.arg("file")
|
|
.arg("--data-dir")
|
|
.arg(fixture.dir())
|
|
.arg("--server-id")
|
|
.arg(DEFAULT_SERVER_ID.to_string())
|
|
.arg(&db_name)
|
|
.assert()
|
|
.success()
|
|
.stdout(
|
|
predicate::str::contains("Transaction").and(predicate::str::contains("DecodeError")),
|
|
);
|
|
}
|
|
|
|
#[tokio::test]
|
|
async fn test_git_version() {
|
|
Command::cargo_bin("influxdb_iox")
|
|
.unwrap()
|
|
.arg("--version")
|
|
.assert()
|
|
.success()
|
|
.stdout(
|
|
predicate::str::contains("UNKNOWN")
|
|
.not()
|
|
.and(predicate::str::is_match("revision [0-9a-f]{40}").unwrap()),
|
|
);
|
|
}
|
|
|
|
#[tokio::test]
|
|
async fn test_print_cpu() {
|
|
Command::cargo_bin("influxdb_iox")
|
|
.unwrap()
|
|
.arg("debug")
|
|
.arg("print-cpu")
|
|
.assert()
|
|
.success()
|
|
.stdout(predicate::str::contains(
|
|
"rustc is using the following target options",
|
|
));
|
|
}
|