Skip to content

Commit

Permalink
chore: Refactor behavior test (#2189)
Browse files Browse the repository at this point in the history
* chore: Refactor behavior test

Signed-off-by: Xuanwo <[email protected]>

* We don't need cfg-if anymore

Signed-off-by: Xuanwo <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored May 1, 2023
1 parent bf26408 commit 46822e6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ services-gcs = [
"reqsign?/services-google",
"reqsign?/reqwest_request",
]
services-gdrive = []
services-ghac = []
services-hdfs = ["dep:hdrs"]
services-http = []
Expand All @@ -124,7 +125,6 @@ services-obs = [
"reqsign?/reqwest_request",
]
services-onedrive = []
services-gdrive = []
services-oss = [
"dep:reqsign",
"reqsign?/services-aliyun",
Expand Down Expand Up @@ -216,7 +216,6 @@ tracing = { version = "0.1", optional = true }
uuid = { version = "1", features = ["serde", "v4"] }

[dev-dependencies]
cfg-if = "1"
criterion = { version = "0.4", features = ["async", "async_tokio"] }
dotenvy = "0.15"
env_logger = "0.10"
Expand Down
45 changes: 34 additions & 11 deletions core/tests/behavior/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,26 +91,49 @@ macro_rules! behavior_tests {
};
}

#[cfg(feature = "services-azblob")]
behavior_tests!(Azblob);
#[cfg(feature = "services-azdfs")]
behavior_tests!(Azdfs);
cfg_if::cfg_if! { if #[cfg(feature = "services-dashmap")] { behavior_tests!(Dashmap); }}
#[cfg(feature = "services-dashmap")]
behavior_tests!(Dashmap);
#[cfg(feature = "services-fs")]
behavior_tests!(Fs);
cfg_if::cfg_if! { if #[cfg(feature = "services-ftp")] { behavior_tests!(Ftp); }}
cfg_if::cfg_if! { if #[cfg(feature = "services-memcached")] { behavior_tests!(Memcached); }}
#[cfg(feature = "services-ftp")]
behavior_tests!(Ftp);
#[cfg(feature = "services-memcached")]
behavior_tests!(Memcached);
#[cfg(feature = "services-memory")]
behavior_tests!(Memory);
cfg_if::cfg_if! { if #[cfg(feature = "services-moka")] { behavior_tests!(Moka); }}
#[cfg(feature = "services-moka")]
behavior_tests!(Moka);
#[cfg(feature = "services-gcs")]
behavior_tests!(Gcs);
#[cfg(feature = "services-ghac")]
behavior_tests!(Ghac);
cfg_if::cfg_if! { if #[cfg(feature = "services-ipfs")] { behavior_tests!(Ipfs); }}
#[cfg(feature = "services-ipfs")]
behavior_tests!(Ipfs);
#[cfg(feature = "services-ipmfs")]
behavior_tests!(Ipmfs);
cfg_if::cfg_if! { if #[cfg(feature = "services-hdfs")] { behavior_tests!(Hdfs); }}
cfg_if::cfg_if! { if #[cfg(feature = "services-http")] { behavior_tests!(Http); }}
#[cfg(feature = "services-hdfs")]
behavior_tests!(Hdfs);
#[cfg(feature = "services-http")]
behavior_tests!(Http);
#[cfg(feature = "services-obs")]
behavior_tests!(Obs);
cfg_if::cfg_if! { if #[cfg(feature = "services-redis")] { behavior_tests!(Redis); }}
cfg_if::cfg_if! { if #[cfg(feature = "services-rocksdb")] { behavior_tests!(Rocksdb); }}
#[cfg(feature = "services-redis")]
behavior_tests!(Redis);
#[cfg(feature = "services-rocksdb")]
behavior_tests!(Rocksdb);
#[cfg(feature = "services-oss")]
behavior_tests!(Oss);
#[cfg(feature = "services-s3")]
behavior_tests!(S3);
cfg_if::cfg_if! { if #[cfg(feature = "services-sftp")] { behavior_tests!(Sftp); }}
cfg_if::cfg_if! { if #[cfg(feature = "services-sled")] { behavior_tests!(Sled); }}
#[cfg(feature = "services-sftp")]
behavior_tests!(Sftp);
#[cfg(feature = "services-sled")]
behavior_tests!(Sled);
#[cfg(feature = "services-webdav")]
behavior_tests!(Webdav);
#[cfg(feature = "services-webhdfs")]
behavior_tests!(Webhdfs);

0 comments on commit 46822e6

Please sign in to comment.