github-actions[bot] commented on code in PR #17246:
URL: https://github.com/apache/doris/pull/17246#discussion_r1119939854


##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,20 +41,24 @@ static const std::string kTestDir = 
"./ut_dir/tablet_cooldown_test";
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+
 // remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+// #define TabletCooldownTest DISABLED_TabletCooldownTest
 class TabletCooldownTest : public testing::Test {
 public:
+    class S3ClientMock : public Aws::S3::S3Client {

Review Comment:
   warning: base class has incomplete type [clang-diagnostic-error]
   ```cpp
       class S3ClientMock : public Aws::S3::S3Client {
                                   ^
   ```
   **be/src/util/s3_util.h:29:** forward declaration of 'Aws::S3::S3Client'
   ```cpp
   class S3Client;
         ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,20 +41,24 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+
 // remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+// #define TabletCooldownTest DISABLED_TabletCooldownTest
 class TabletCooldownTest : public testing::Test {
 public:
+    class S3ClientMock : public Aws::S3::S3Client {
+        S3ClientMock() {}
+
+        S3ClientMock(const Aws::Auth::AWSCredentials &credentials,
+                     const Aws::Client::ClientConfiguration 
&clientConfiguration,
+                     Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy 
signPayloads,
+                     bool use_virtual_addressing)
+                : Aws::S3::S3Client(credentials, clientConfiguration, 
signPayloads,

Review Comment:
   warning: type 'Aws::S3::S3Client' is not a direct or virtual base of 
'doris::TabletCooldownTest::S3ClientMock' [clang-diagnostic-error]
   ```cpp
                   : Aws::S3::S3Client(credentials, clientConfiguration, 
signPayloads,
                     ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,20 +41,24 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+
 // remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+// #define TabletCooldownTest DISABLED_TabletCooldownTest
 class TabletCooldownTest : public testing::Test {
 public:
+    class S3ClientMock : public Aws::S3::S3Client {
+        S3ClientMock() {}
+
+        S3ClientMock(const Aws::Auth::AWSCredentials &credentials,
+                     const Aws::Client::ClientConfiguration 
&clientConfiguration,
+                     Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy 
signPayloads,
+                     bool use_virtual_addressing)
+                : Aws::S3::S3Client(credentials, clientConfiguration, 
signPayloads,
+                                    use_virtual_addressing) {}
+    };
+
     static void SetUpTestSuite() {
-        S3Conf s3_conf;
-        s3_conf.ak = config::test_s3_ak;
-        s3_conf.sk = config::test_s3_sk;
-        s3_conf.endpoint = config::test_s3_endpoint;
-        s3_conf.region = config::test_s3_region;
-        s3_conf.bucket = config::test_s3_bucket;
-        s3_conf.prefix = config::test_s3_prefix + "/tablet_cooldown_test";
-        auto s3_fs = io::S3FileSystem::create(std::move(s3_conf), 
std::to_string(kResourceId));
-        ASSERT_TRUE(s3_fs->connect().ok());
+        S3ClientMock s3_fs;
         put_storage_resource(kResourceId, {s3_fs, 1});

Review Comment:
   warning: no matching function for call to 'put_storage_resource' 
[clang-diagnostic-error]
   ```cpp
           put_storage_resource(kResourceId, {s3_fs, 1});
           ^
   ```
   **be/src/olap/storage_policy.h:66:** candidate function not viable: cannot 
convert initializer list argument to 'doris::StorageResource'
   ```cpp
   void put_storage_resource(int64_t resource_id, StorageResource resource);
        ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,20 +41,24 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+
 // remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+// #define TabletCooldownTest DISABLED_TabletCooldownTest
 class TabletCooldownTest : public testing::Test {
 public:
+    class S3ClientMock : public Aws::S3::S3Client {
+        S3ClientMock() {}
+
+        S3ClientMock(const Aws::Auth::AWSCredentials &credentials,
+                     const Aws::Client::ClientConfiguration 
&clientConfiguration,
+                     Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy 
signPayloads,
+                     bool use_virtual_addressing)
+                : Aws::S3::S3Client(credentials, clientConfiguration, 
signPayloads,
+                                    use_virtual_addressing) {}
+    };
+
     static void SetUpTestSuite() {
-        S3Conf s3_conf;
-        s3_conf.ak = config::test_s3_ak;
-        s3_conf.sk = config::test_s3_sk;
-        s3_conf.endpoint = config::test_s3_endpoint;
-        s3_conf.region = config::test_s3_region;
-        s3_conf.bucket = config::test_s3_bucket;
-        s3_conf.prefix = config::test_s3_prefix + "/tablet_cooldown_test";
-        auto s3_fs = io::S3FileSystem::create(std::move(s3_conf), 
std::to_string(kResourceId));
-        ASSERT_TRUE(s3_fs->connect().ok());
+        S3ClientMock s3_fs;

Review Comment:
   warning: calling a private constructor of class 
'doris::TabletCooldownTest::S3ClientMock' [clang-diagnostic-error]
   ```cpp
           S3ClientMock s3_fs;
                        ^
   ```
   **be/test/olap/tablet_cooldown_test.cpp:49:** implicitly declared private 
here
   ```cpp
           S3ClientMock() {}
           ^
   ```
   



##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,20 +41,24 @@
 static constexpr int64_t kResourceId = 10000;
 static constexpr int64_t kStoragePolicyId = 10002;
 
+
 // remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+// #define TabletCooldownTest DISABLED_TabletCooldownTest
 class TabletCooldownTest : public testing::Test {
 public:
+    class S3ClientMock : public Aws::S3::S3Client {
+        S3ClientMock() {}

Review Comment:
   warning: use '= default' to define a trivial default constructor 
[modernize-use-equals-default]
   
   ```suggestion
           S3ClientMock() = default;
   ```
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to