From 33284945af706e2e45cc7c3c34e146d7627cdb39 Mon Sep 17 00:00:00 2001 From: wayne warren Date: Fri, 17 Jan 2025 14:20:36 -0700 Subject: [PATCH] chore: remove explicit predicates dependency --- Cargo.lock | 19 ------------------- Cargo.toml | 1 - influxdb3/Cargo.toml | 1 - influxdb3/tests/server/cli.rs | 35 +++++++++++++++++++++++++---------- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1154eefcec4..0cd165f9fa4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1980,15 +1980,6 @@ dependencies = [ "workspace-hack", ] -[[package]] -name = "float-cmp" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" -dependencies = [ - "num-traits", -] - [[package]] name = "flume" version = "0.11.1" @@ -2779,7 +2770,6 @@ dependencies = [ "panic_logging", "parking_lot", "parquet_file", - "predicates", "pretty_assertions", "rand", "reqwest 0.11.27", @@ -3947,12 +3937,6 @@ dependencies = [ "delegate", ] -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - [[package]] name = "ntapi" version = "0.4.1" @@ -4591,10 +4575,7 @@ checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", "difflib", - "float-cmp", - "normalize-line-endings", "predicates-core", - "regex", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 225c844a342..7bb9bda7036 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,6 @@ pbjson = "0.6.0" pbjson-build = "0.6.2" pbjson-types = "0.6.0" pin-project-lite = "0.2" -predicates = "3.1.3" pretty_assertions = "1.4.0" prost = "0.12.6" prost-build = "0.12.6" diff --git a/influxdb3/Cargo.toml b/influxdb3/Cargo.toml index a8f2f3ec383..e4d797b2ba9 100644 --- a/influxdb3/Cargo.toml +++ b/influxdb3/Cargo.toml @@ -97,4 +97,3 @@ test_helpers.workspace = true tonic.workspace = true tower.workspace = true test-log.workspace = true -predicates.workspace = true diff --git a/influxdb3/tests/server/cli.rs b/influxdb3/tests/server/cli.rs index d22985a806c..feac7ef5925 100644 --- a/influxdb3/tests/server/cli.rs +++ b/influxdb3/tests/server/cli.rs @@ -8,13 +8,12 @@ use crate::{ConfigProvider, TestServer}; use assert_cmd::cargo::CommandCargoExt; use assert_cmd::Command as AssertCmd; use observability_deps::tracing::debug; -use predicates::boolean::PredicateBooleanExt; use pretty_assertions::assert_eq; use serde_json::{json, Value}; -use test_helpers::assert_contains; use test_helpers::tempfile::NamedTempFile; #[cfg(feature = "system-py")] use test_helpers::tempfile::TempDir; +use test_helpers::{assert_contains, assert_not_contains}; const WRITE_REPORTS_PLUGIN_CODE: &str = r#" def process_writes(influxdb3_local, table_batches, args=None): @@ -122,7 +121,7 @@ async fn test_telemetry_disabled_with_debug_msg() { let expected_disabled: &str = "Initializing TelemetryStore with upload disabled."; // validate we get a debug message indicating upload disabled - AssertCmd::cargo_bin("influxdb3") + let output = AssertCmd::cargo_bin("influxdb3") .unwrap() .args(serve_args) .arg("-vv") @@ -130,7 +129,11 @@ async fn test_telemetry_disabled_with_debug_msg() { .timeout(std::time::Duration::from_millis(500)) .assert() .failure() - .stdout(predicates::str::contains(expected_disabled)); + .get_output() + .stdout + .clone(); + let output = String::from_utf8(output).expect("must be able to convert output to String"); + assert_contains!(output, expected_disabled); } #[test_log::test(tokio::test)] @@ -145,7 +148,7 @@ async fn test_telemetry_disabled() { let expected_disabled: &str = "Initializing TelemetryStore with upload disabled."; // validate no message when debug output disabled - AssertCmd::cargo_bin("influxdb3") + let output = AssertCmd::cargo_bin("influxdb3") .unwrap() .args(serve_args) .arg("-v") @@ -153,7 +156,11 @@ async fn test_telemetry_disabled() { .timeout(std::time::Duration::from_millis(500)) .assert() .failure() - .stdout(predicates::str::contains(expected_disabled).not()); + .get_output() + .stdout + .clone(); + let output = String::from_utf8(output).expect("must be able to convert output to String"); + assert_not_contains!(output, expected_disabled); } #[test_log::test(tokio::test)] @@ -170,7 +177,7 @@ async fn test_telemetry_enabled_with_debug_msg() { "Initializing TelemetryStore with upload enabled for http://localhost:9999."; // validate debug output shows which endpoint we are hitting when telemetry enabled - AssertCmd::cargo_bin("influxdb3") + let output = AssertCmd::cargo_bin("influxdb3") .unwrap() .args(serve_args) .arg("-vv") @@ -179,7 +186,11 @@ async fn test_telemetry_enabled_with_debug_msg() { .timeout(std::time::Duration::from_millis(500)) .assert() .failure() - .stdout(predicates::str::contains(expected_enabled)); + .get_output() + .stdout + .clone(); + let output = String::from_utf8(output).expect("must be able to convert output to String"); + assert_contains!(output, expected_enabled); } #[test_log::test(tokio::test)] @@ -196,7 +207,7 @@ async fn test_telementry_enabled() { "Initializing TelemetryStore with upload enabled for http://localhost:9999."; // validate no telemetry endpoint reported when debug output not enabled - AssertCmd::cargo_bin("influxdb3") + let output = AssertCmd::cargo_bin("influxdb3") .unwrap() .args(serve_args) .arg("-v") @@ -205,7 +216,11 @@ async fn test_telementry_enabled() { .timeout(std::time::Duration::from_millis(500)) .assert() .failure() - .stdout(predicates::str::contains(expected_enabled).not()); + .get_output() + .stdout + .clone(); + let output = String::from_utf8(output).expect("must be able to convert output to String"); + assert_not_contains!(output, expected_enabled); } #[test_log::test(tokio::test)]