FANNG1 commented on code in PR #6160:
URL: https://github.com/apache/gravitino/pull/6160#discussion_r1910047540
##########
clients/filesystem-fuse/src/open_dal_filesystem.rs:
##########
@@ -261,22 +261,29 @@ fn opendal_filemode_to_filetype(mode: EntryMode) ->
FileType {
mod test {
use crate::config::AppConfig;
use crate::s3_filesystem::extract_s3_config;
+ use crate::s3_filesystem::tests::s3_test_config;
+ use crate::test_enable_with;
+ use crate::RUN_TEST_WITH_S3;
use opendal::layers::LoggingLayer;
use opendal::{services, Builder, Operator};
- #[tokio::test]
- async fn test_s3_stat() {
- let config =
AppConfig::from_file(Some("tests/conf/gvfs_fuse_s3.toml")).unwrap();
- let opendal_config = extract_s3_config(&config);
-
+ fn create_opendal(config: &AppConfig) -> Operator {
+ let opendal_config = extract_s3_config(config);
let builder = services::S3::from_map(opendal_config);
// Init an operator
- let op = Operator::new(builder)
+ Operator::new(builder)
.expect("opendal create failed")
.layer(LoggingLayer::default())
- .finish();
+ .finish()
+ }
+
+ #[tokio::test]
+ async fn s3_ut_test_s3_stat() {
Review Comment:
`s3_ut_test_s3_stat` is duplicate, How about `test_s3_stat`?
##########
clients/filesystem-fuse/src/open_dal_filesystem.rs:
##########
@@ -261,22 +261,29 @@ fn opendal_filemode_to_filetype(mode: EntryMode) ->
FileType {
mod test {
use crate::config::AppConfig;
use crate::s3_filesystem::extract_s3_config;
+ use crate::s3_filesystem::tests::s3_test_config;
+ use crate::test_enable_with;
+ use crate::RUN_TEST_WITH_S3;
use opendal::layers::LoggingLayer;
use opendal::{services, Builder, Operator};
- #[tokio::test]
- async fn test_s3_stat() {
- let config =
AppConfig::from_file(Some("tests/conf/gvfs_fuse_s3.toml")).unwrap();
- let opendal_config = extract_s3_config(&config);
-
+ fn create_opendal(config: &AppConfig) -> Operator {
+ let opendal_config = extract_s3_config(config);
let builder = services::S3::from_map(opendal_config);
// Init an operator
- let op = Operator::new(builder)
+ Operator::new(builder)
.expect("opendal create failed")
.layer(LoggingLayer::default())
- .finish();
+ .finish()
+ }
+
+ #[tokio::test]
+ async fn s3_ut_test_s3_stat() {
+ test_enable_with!(RUN_TEST_WITH_S3);
Review Comment:
this seems hacks, could you refer other rust projects for more general way
to control the tests?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]