Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Move not initiated logic to utils instead #2196

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/tests/behavior/blocking_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ macro_rules! behavior_blocking_copy_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/blocking_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ macro_rules! behavior_blocking_list_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/blocking_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ macro_rules! behavior_blocking_read_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/blocking_rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ macro_rules! behavior_blocking_rename_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/blocking_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ macro_rules! behavior_blocking_write_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ macro_rules! behavior_copy_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ macro_rules! behavior_list_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/list_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ macro_rules! behavior_list_only_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
4 changes: 3 additions & 1 deletion core/tests/behavior/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ macro_rules! behavior_tests {
($($service:ident),*) => {
paste::item! {
$(
mod [<services_ $service:lower>] {
mod [<services_ $service:snake>] {
use once_cell::sync::Lazy;

static RUNTIME: Lazy<tokio::runtime::Runtime> = Lazy::new(|| {
Expand Down Expand Up @@ -133,6 +133,8 @@ behavior_tests!(S3);
behavior_tests!(Sftp);
#[cfg(feature = "services-sled")]
behavior_tests!(Sled);
#[cfg(feature = "services-vercel-artifacts")]
behavior_tests!(VercelArtifacts);
#[cfg(feature = "services-webdav")]
behavior_tests!(Webdav);
#[cfg(feature = "services-webhdfs")]
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/presign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ macro_rules! behavior_presign_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/read_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ macro_rules! behavior_read_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ macro_rules! behavior_rename_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/tests/behavior/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use std::usize;

use bytes::Bytes;
use log::debug;
use log::warn;
use opendal::layers::LoggingLayer;
use opendal::layers::RetryLayer;
use opendal::*;
Expand Down Expand Up @@ -54,6 +55,7 @@ pub fn init_service<B: Builder>() -> Option<Operator> {
let turn_on_test = cfg.get("test").cloned().unwrap_or_default();

if turn_on_test != "on" && turn_on_test != "true" {
warn!("service {} not initiated, ignored", B::SCHEME);
return None;
}

Expand Down
1 change: 0 additions & 1 deletion core/tests/behavior/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ macro_rules! behavior_write_test {
Ok(())
},
None => {
log::warn!("service {} not initiated, ignored", opendal::Scheme::$service);
Ok(())
}
}
Expand Down