From 1a5e3115ba49a7cf0a951f66034207bdac99659a Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Mon, 11 Mar 2024 00:18:28 +0000 Subject: [PATCH 01/10] bump --- influxdb/src/client/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index ad198bc..be40165 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -281,7 +281,7 @@ impl Client { })?; // todo: improve error parsing without serde - if s.contains("\"error\"") { + if s.contains("\"error\"") || s.contains("\"Error\"") { return Err(Error::DatabaseError { error: format!("influxdb error: \"{}\"", s), }); From f26c4da0abca7ab2d37de0313ccdf5a54b804ac0 Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Mon, 11 Mar 2024 00:31:59 +0000 Subject: [PATCH 02/10] error with an api status code --- influxdb/src/client/mod.rs | 9 +++------ influxdb/src/error.rs | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index be40165..80da364 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -301,13 +301,10 @@ impl Client { pub(crate) fn check_status(res: &HttpResponse) -> Result<(), Error> { let status = res.status(); - if status == StatusCode::UNAUTHORIZED.as_u16() { - Err(Error::AuthorizationError) - } else if status == StatusCode::FORBIDDEN.as_u16() { - Err(Error::AuthenticationError) - } else { - Ok(()) + if !status.is_success() { + return Err(Error::ApiError(status)); } + Ok(()) } #[cfg(test)] diff --git a/influxdb/src/error.rs b/influxdb/src/error.rs index 8bfd043..fff9e59 100644 --- a/influxdb/src/error.rs +++ b/influxdb/src/error.rs @@ -1,5 +1,6 @@ //! Errors that might happen in the crate +use http::StatusCode; use thiserror::Error; #[derive(Debug, Eq, PartialEq, Error)] @@ -33,6 +34,10 @@ pub enum Error { /// Error happens when the supplied user is not authorized. `HTTP 403 Forbidden` AuthorizationError, + #[error("API error with a status code: {0}")] + /// Error happens when API returns non 2xx status code. + ApiError(StatusCode), + #[error("connection error: {error}")] /// Error happens when HTTP request fails ConnectionError { error: String }, From b25393c391321b1a85fbeea8177372b1166bbf5d Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Mon, 11 Mar 2024 00:39:50 +0000 Subject: [PATCH 03/10] remove redundant import --- influxdb/src/client/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index 80da364..dd141c5 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -16,7 +16,6 @@ //! ``` use futures_util::TryFutureExt; -use http::StatusCode; #[cfg(feature = "reqwest")] use reqwest::{Client as HttpClient, RequestBuilder, Response as HttpResponse}; use std::collections::{BTreeMap, HashMap}; From f2f6858be27c756e58c46d474d4c56a4aa3427fa Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Wed, 13 Mar 2024 18:14:45 +0000 Subject: [PATCH 04/10] fix ApiError --- influxdb/src/client/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index dd141c5..7807a24 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -301,7 +301,11 @@ impl Client { pub(crate) fn check_status(res: &HttpResponse) -> Result<(), Error> { let status = res.status(); if !status.is_success() { - return Err(Error::ApiError(status)); + #[cfg(feature = "surf")] + let err = Err(Error::ApiError(status.into())); + #[cfg(feature = "reqwest")] + let err = Err(Error::ApiError(status)); + return err; } Ok(()) } From 4dd663ed2fb724a0f15cc0023723137ea4f628a6 Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Wed, 13 Mar 2024 18:25:36 +0000 Subject: [PATCH 05/10] fix ApiError by converting StatusCode to u16 --- influxdb/src/client/mod.rs | 5 +---- influxdb/src/error.rs | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index 7807a24..6bf5c4a 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -301,10 +301,7 @@ impl Client { pub(crate) fn check_status(res: &HttpResponse) -> Result<(), Error> { let status = res.status(); if !status.is_success() { - #[cfg(feature = "surf")] - let err = Err(Error::ApiError(status.into())); - #[cfg(feature = "reqwest")] - let err = Err(Error::ApiError(status)); + let err = Err(Error::ApiError(status.as_u16())); return err; } Ok(()) diff --git a/influxdb/src/error.rs b/influxdb/src/error.rs index fff9e59..0e1f0ae 100644 --- a/influxdb/src/error.rs +++ b/influxdb/src/error.rs @@ -1,6 +1,5 @@ //! Errors that might happen in the crate -use http::StatusCode; use thiserror::Error; #[derive(Debug, Eq, PartialEq, Error)] @@ -36,7 +35,7 @@ pub enum Error { #[error("API error with a status code: {0}")] /// Error happens when API returns non 2xx status code. - ApiError(StatusCode), + ApiError(u16), #[error("connection error: {error}")] /// Error happens when HTTP request fails From 72c5095bbc6864cb1bb7f2ce3b7d50482e05da20 Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Wed, 13 Mar 2024 18:44:41 +0000 Subject: [PATCH 06/10] revert --- influxdb/src/client/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index 6bf5c4a..ff6c9bf 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -301,8 +301,10 @@ impl Client { pub(crate) fn check_status(res: &HttpResponse) -> Result<(), Error> { let status = res.status(); if !status.is_success() { - let err = Err(Error::ApiError(status.as_u16())); - return err; + #[cfg(feature = "surf")] + return Err(Error::ApiError(status.into())); + #[cfg(feature = "reqwest")] + return Err(Error::ApiError(status)); } Ok(()) } From 7669757276f71b9e8576ff38855cee6f14afb9ac Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Wed, 13 Mar 2024 20:54:01 +0000 Subject: [PATCH 07/10] u16 as StatusCode --- influxdb/src/client/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index ff6c9bf..264cfde 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -301,10 +301,7 @@ impl Client { pub(crate) fn check_status(res: &HttpResponse) -> Result<(), Error> { let status = res.status(); if !status.is_success() { - #[cfg(feature = "surf")] return Err(Error::ApiError(status.into())); - #[cfg(feature = "reqwest")] - return Err(Error::ApiError(status)); } Ok(()) } From b943dbb109695981712d0f89ce95ba4810401956 Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Wed, 13 Mar 2024 21:13:05 +0000 Subject: [PATCH 08/10] update tests --- influxdb/src/error.rs | 8 ---- influxdb/tests/integration_tests.rs | 54 +++++++++++++++++++++++--- influxdb/tests/integration_tests_v2.rs | 36 +++++++++++++++-- 3 files changed, 80 insertions(+), 18 deletions(-) diff --git a/influxdb/src/error.rs b/influxdb/src/error.rs index 0e1f0ae..5f89e8f 100644 --- a/influxdb/src/error.rs +++ b/influxdb/src/error.rs @@ -25,14 +25,6 @@ pub enum Error { /// Error which has happened inside InfluxDB DatabaseError { error: String }, - #[error("authentication error. No or incorrect credentials")] - /// Error happens when no or incorrect credentials are used. `HTTP 401 Unauthorized` - AuthenticationError, - - #[error("authorization error. User not authorized")] - /// Error happens when the supplied user is not authorized. `HTTP 403 Forbidden` - AuthorizationError, - #[error("API error with a status code: {0}")] /// Error happens when API returns non 2xx status code. ApiError(u16), diff --git a/influxdb/tests/integration_tests.rs b/influxdb/tests/integration_tests.rs index f392f95..539a6e7 100644 --- a/influxdb/tests/integration_tests.rs +++ b/influxdb/tests/integration_tests.rs @@ -140,7 +140,14 @@ async fn test_wrong_authed_write_and_read() { let write_result = client.query(write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", write_result.unwrap_err() @@ -151,7 +158,14 @@ async fn test_wrong_authed_write_and_read() { let read_result = client.query(read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", read_result.unwrap_err() @@ -164,7 +178,14 @@ async fn test_wrong_authed_write_and_read() { let read_result = client.query(read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::AuthenticationError) => {} + Err(Error::ApiError(code)) => { + if code != 401 { + panic!( + "Should be an ApiError(401), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthenticationError: {}", read_result.unwrap_err() @@ -208,7 +229,14 @@ async fn test_non_authed_write_and_read() { let write_result = non_authed_client.query(write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", write_result.unwrap_err() @@ -220,7 +248,14 @@ async fn test_non_authed_write_and_read() { assert_result_err(&read_result); match read_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", read_result.unwrap_err() @@ -297,7 +332,14 @@ async fn test_json_non_authed_read() { let read_result = non_authed_client.json_query(read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be a AuthorizationError: {}", read_result.unwrap_err() diff --git a/influxdb/tests/integration_tests_v2.rs b/influxdb/tests/integration_tests_v2.rs index 74e17a7..fbdac98 100644 --- a/influxdb/tests/integration_tests_v2.rs +++ b/influxdb/tests/integration_tests_v2.rs @@ -57,7 +57,14 @@ async fn test_wrong_authed_write_and_read() { let write_result = client.query(&write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", write_result.unwrap_err() @@ -68,7 +75,14 @@ async fn test_wrong_authed_write_and_read() { let read_result = client.query(&read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", read_result.unwrap_err() @@ -95,7 +109,14 @@ async fn test_non_authed_write_and_read() { let write_result = non_authed_client.query(&write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", write_result.unwrap_err() @@ -106,7 +127,14 @@ async fn test_non_authed_write_and_read() { let read_result = non_authed_client.query(&read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::AuthorizationError) => {} + Err(Error::ApiError(code)) => { + if code != 403 { + panic!( + "Should be an ApiError(403), but code received was: {}", + code + ); + } + } _ => panic!( "Should be an AuthorizationError: {}", read_result.unwrap_err() From 9e2b74b264e70e331c499f9c0fc7a15e33261885 Mon Sep 17 00:00:00 2001 From: 0xDmtri <0xDmtri@protonmail.com> Date: Thu, 14 Mar 2024 16:33:58 +0000 Subject: [PATCH 09/10] improve tests readability --- influxdb/tests/integration_tests.rs | 72 +++++++------------------- influxdb/tests/integration_tests_v2.rs | 48 +++++------------ 2 files changed, 30 insertions(+), 90 deletions(-) diff --git a/influxdb/tests/integration_tests.rs b/influxdb/tests/integration_tests.rs index 539a6e7..bb3ab46 100644 --- a/influxdb/tests/integration_tests.rs +++ b/influxdb/tests/integration_tests.rs @@ -120,6 +120,8 @@ async fn test_authed_write_and_read() { #[async_std::test] #[cfg(not(tarpaulin_include))] async fn test_wrong_authed_write_and_read() { + use http::StatusCode; + const TEST_NAME: &str = "test_wrong_authed_write_and_read"; run_test( @@ -140,16 +142,9 @@ async fn test_wrong_authed_write_and_read() { let write_result = client.query(write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", write_result.unwrap_err() ), } @@ -158,16 +153,9 @@ async fn test_wrong_authed_write_and_read() { let read_result = client.query(read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", read_result.unwrap_err() ), } @@ -178,16 +166,9 @@ async fn test_wrong_authed_write_and_read() { let read_result = client.query(read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::ApiError(code)) => { - if code != 401 { - panic!( - "Should be an ApiError(401), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::FORBIDDEN.as_u16() => {} _ => panic!( - "Should be an AuthenticationError: {}", + "Should be an ApiError(UNAUTHENTICATED): {}", read_result.unwrap_err() ), } @@ -211,6 +192,8 @@ async fn test_wrong_authed_write_and_read() { #[async_std::test] #[cfg(not(tarpaulin_include))] async fn test_non_authed_write_and_read() { + use http::StatusCode; + const TEST_NAME: &str = "test_non_authed_write_and_read"; run_test( @@ -229,16 +212,9 @@ async fn test_non_authed_write_and_read() { let write_result = non_authed_client.query(write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", write_result.unwrap_err() ), } @@ -248,16 +224,9 @@ async fn test_non_authed_write_and_read() { assert_result_err(&read_result); match read_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", read_result.unwrap_err() ), } @@ -315,6 +284,8 @@ async fn test_write_and_read_field() { #[cfg(feature = "serde")] #[cfg(not(tarpaulin_include))] async fn test_json_non_authed_read() { + use http::StatusCode; + const TEST_NAME: &str = "test_json_non_authed_read"; run_test( @@ -332,16 +303,9 @@ async fn test_json_non_authed_read() { let read_result = non_authed_client.json_query(read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be a AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", read_result.unwrap_err() ), } diff --git a/influxdb/tests/integration_tests_v2.rs b/influxdb/tests/integration_tests_v2.rs index fbdac98..fb8057d 100644 --- a/influxdb/tests/integration_tests_v2.rs +++ b/influxdb/tests/integration_tests_v2.rs @@ -48,6 +48,8 @@ async fn test_authed_write_and_read() { #[async_std::test] #[cfg(not(tarpaulin))] async fn test_wrong_authed_write_and_read() { + use http::StatusCode; + run_test( || async move { let client = Client::new("http://127.0.0.1:2086", "mydb").with_token("falsetoken"); @@ -57,16 +59,9 @@ async fn test_wrong_authed_write_and_read() { let write_result = client.query(&write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", write_result.unwrap_err() ), } @@ -75,16 +70,9 @@ async fn test_wrong_authed_write_and_read() { let read_result = client.query(&read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", read_result.unwrap_err() ), } @@ -100,6 +88,8 @@ async fn test_wrong_authed_write_and_read() { #[async_std::test] #[cfg(not(tarpaulin))] async fn test_non_authed_write_and_read() { + use http::StatusCode; + run_test( || async move { let non_authed_client = Client::new("http://127.0.0.1:2086", "mydb"); @@ -109,16 +99,9 @@ async fn test_non_authed_write_and_read() { let write_result = non_authed_client.query(&write_query).await; assert_result_err(&write_result); match write_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", write_result.unwrap_err() ), } @@ -127,16 +110,9 @@ async fn test_non_authed_write_and_read() { let read_result = non_authed_client.query(&read_query).await; assert_result_err(&read_result); match read_result { - Err(Error::ApiError(code)) => { - if code != 403 { - panic!( - "Should be an ApiError(403), but code received was: {}", - code - ); - } - } + Err(Error::ApiError(code)) if code == StatusCode::UNAUTHORIZED.as_u16() => {} _ => panic!( - "Should be an AuthorizationError: {}", + "Should be an ApiError(UNAUTHORIZED): {}", read_result.unwrap_err() ), } From 17126aaa935c34e029dd7d2e45731d4981920d0b Mon Sep 17 00:00:00 2001 From: Gero Gerke Date: Tue, 2 Apr 2024 14:27:32 +0200 Subject: [PATCH 10/10] fix: ci tests & add docker-compose local test harness --- docker-compose.integrationtest.yaml | 27 ++++++++++++++++++++++++++ influxdb/tests/integration_tests_v2.rs | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 docker-compose.integrationtest.yaml diff --git a/docker-compose.integrationtest.yaml b/docker-compose.integrationtest.yaml new file mode 100644 index 0000000..1fd549d --- /dev/null +++ b/docker-compose.integrationtest.yaml @@ -0,0 +1,27 @@ +version: '3' +services: + influxdb: + image: influxdb:1.8 + ports: + - 8086:8086 + authed_influxdb: + image: influxdb:1.8 + ports: + - 9086:8086 + environment: + INFLUXDB_HTTP_AUTH_ENABLED: true + INFLUXDB_ADMIN_USER: admin + INFLUXDB_ADMIN_PASSWORD: password + INFLUXDB_USER: nopriv_user + INFLUXDB_USER_PASSWORD: password + influxdbv2: + image: influxdb:2.6 + ports: + - 2086:8086 + environment: + DOCKER_INFLUXDB_INIT_MODE: setup + DOCKER_INFLUXDB_INIT_USERNAME: admin + DOCKER_INFLUXDB_INIT_PASSWORD: password + DOCKER_INFLUXDB_INIT_ORG: testing + DOCKER_INFLUXDB_INIT_BUCKET: mydb + DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: admintoken diff --git a/influxdb/tests/integration_tests_v2.rs b/influxdb/tests/integration_tests_v2.rs index fb8057d..8c47e2a 100644 --- a/influxdb/tests/integration_tests_v2.rs +++ b/influxdb/tests/integration_tests_v2.rs @@ -33,7 +33,7 @@ async fn test_authed_write_and_read() { }, || async move { let client = Client::new("http://127.0.0.1:2086", "mydb").with_token("admintoken"); - let read_query = ReadQuery::new("DELETE MEASUREMENT weather"); + let read_query = ReadQuery::new("DROP MEASUREMENT \"weather\""); let read_result = client.query(read_query).await; assert_result_ok(&read_result); assert!(!read_result.unwrap().contains("error"), "Teardown failed");