test: Allow integration tests that should_panic to pass if TEST_INTEGRATION isn't set
parent
02c7ed58a2
commit
f56123bf30
|
@ -892,7 +892,10 @@ mod kafkaless_rpc_write {
|
|||
#[should_panic(expected = "did not get additional Parquet files in the catalog")]
|
||||
async fn never_persist_really_never_persists() {
|
||||
test_helpers::maybe_start_logging();
|
||||
let database_url = maybe_skip_integration!();
|
||||
// Tell the test to panic with the expected message if `TEST_INTEGRATION` isn't set so that
|
||||
// this still passes
|
||||
let database_url =
|
||||
maybe_skip_integration!("did not get additional Parquet files in the catalog");
|
||||
|
||||
let table_name = "the_table";
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ fn dump_log_to_stdout(server_type: &str, log_path: &std::path::Path) {
|
|||
// variables are not set.
|
||||
#[macro_export]
|
||||
macro_rules! maybe_skip_integration {
|
||||
() => {{
|
||||
($panic_msg:expr) => {{
|
||||
use std::env;
|
||||
dotenvy::dotenv().ok();
|
||||
|
||||
|
@ -126,17 +126,24 @@ macro_rules! maybe_skip_integration {
|
|||
would connect to a Postgres catalog."
|
||||
)
|
||||
}
|
||||
(false, Some(_)) => {
|
||||
eprintln!("skipping end-to-end integration tests - set TEST_INTEGRATION to run");
|
||||
return;
|
||||
}
|
||||
(false, None) => {
|
||||
eprintln!(
|
||||
"skipping end-to-end integration tests - set TEST_INTEGRATION and \
|
||||
TEST_INFLUXDB_IOX_CATALOG_DSN to run"
|
||||
);
|
||||
(false, maybe_dsn) => {
|
||||
let unset_vars = match maybe_dsn {
|
||||
Some(_) => "TEST_INTEGRATION",
|
||||
None => "TEST_INTEGRATION and TEST_INFLUXDB_IOX_CATALOG_DSN",
|
||||
};
|
||||
|
||||
eprintln!("skipping end-to-end integration tests - set {unset_vars} to run");
|
||||
|
||||
let panic_msg: &'static str = $panic_msg;
|
||||
if !panic_msg.is_empty() {
|
||||
panic!("{}", panic_msg);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}};
|
||||
() => {
|
||||
maybe_skip_integration!("")
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue