github-actions[bot] commented on code in PR #17246:
URL: https://github.com/apache/doris/pull/17246#discussion_r1122613258
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@ 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
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
Review Comment:
warning: use '= default' to define a trivial destructor
[modernize-use-equals-default]
```suggestion
~FileWriterMock() = default;
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
+
+ MOCK_METHOD0(close, Status());
+ MOCK_METHOD0(abort, Status());
+ MOCK_METHOD1(append, Status(const Slice& data));
+ MOCK_METHOD2(appendv, Status(const Slice* data, size_t data_cnt));
+ MOCK_METHOD2(write_at, Status(size_t offset, const Slice& data));
+ MOCK_METHOD0(finalize, Status());
+ MOCK_METHOD0(bytes_appended, size_t());
Review Comment:
warning: 'doris::FileWriterMock::bytes_appended' hides overloaded virtual
function [clang-diagnostic-overloaded-virtual]
```cpp
MOCK_METHOD0(bytes_appended, size_t());
^
```
**be/src/io/fs/file_writer.h:53:** hidden overloaded virtual function
'doris::io::FileWriter::bytes_appended' declared here: different qualifiers
('const' vs unqualified)
```cpp
virtual size_t bytes_appended() const = 0;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
+
+ MOCK_METHOD0(close, Status());
+ MOCK_METHOD0(abort, Status());
+ MOCK_METHOD1(append, Status(const Slice& data));
+ MOCK_METHOD2(appendv, Status(const Slice* data, size_t data_cnt));
+ MOCK_METHOD2(write_at, Status(size_t offset, const Slice& data));
+ MOCK_METHOD0(finalize, Status());
+ MOCK_METHOD0(bytes_appended, size_t());
+ MOCK_METHOD0(fs, io::FileSystemSPtr());
Review Comment:
warning: 'doris::FileWriterMock::fs' hides overloaded virtual function
[clang-diagnostic-overloaded-virtual]
```cpp
MOCK_METHOD0(fs, io::FileSystemSPtr());
^
```
**be/src/io/fs/file_writer.h:55:** hidden overloaded virtual function
'doris::io::FileWriter::fs' declared here: different qualifiers ('const' vs
unqualified)
```cpp
virtual std::shared_ptr<FileSystem> fs() const = 0;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
+
+ MOCK_METHOD0(close, Status());
+ MOCK_METHOD0(abort, Status());
+ MOCK_METHOD1(append, Status(const Slice& data));
+ MOCK_METHOD2(appendv, Status(const Slice* data, size_t data_cnt));
+ MOCK_METHOD2(write_at, Status(size_t offset, const Slice& data));
+ MOCK_METHOD0(finalize, Status());
+ MOCK_METHOD0(bytes_appended, size_t());
+ MOCK_METHOD0(fs, io::FileSystemSPtr());
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+ RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType
type)
+ : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+ ~RemoteFileSystemMock() {}
Review Comment:
warning: use '= default' to define a trivial destructor
[modernize-use-equals-default]
```suggestion
~RemoteFileSystemMock() = default;
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
+
+ MOCK_METHOD0(close, Status());
+ MOCK_METHOD0(abort, Status());
+ MOCK_METHOD1(append, Status(const Slice& data));
+ MOCK_METHOD2(appendv, Status(const Slice* data, size_t data_cnt));
+ MOCK_METHOD2(write_at, Status(size_t offset, const Slice& data));
+ MOCK_METHOD0(finalize, Status());
+ MOCK_METHOD0(bytes_appended, size_t());
+ MOCK_METHOD0(fs, io::FileSystemSPtr());
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+ RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType
type)
+ : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+ ~RemoteFileSystemMock() {}
+
+ Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+ *writer = std::make_unique<FileWriterMock>("test_path");
+ return Status::OK();
+ }
+ MOCK_METHOD3(open_file, Status(const Path& path, io::FileReaderSPtr*
reader, IOContext* io_ctx));
+ MOCK_METHOD1(delete_file, Status(const Path& path));
+ MOCK_METHOD1(create_directory, Status(const Path& path));
+ MOCK_METHOD1(delete_directory, Status(const Path& path));
+ MOCK_METHOD2(link_file, Status(const Path& src, const Path& dest));
+ MOCK_METHOD2(exists, Status(const Path& path, bool* res));
+ MOCK_METHOD2(file_size, Status(const Path& path, size_t* file_size));
+ MOCK_METHOD2(list, Status(const Path& path, std::vector<Path>* files));
+ MOCK_METHOD2(upload, Status(const Path& local_path, const Path&
dest_path));
+ MOCK_METHOD2(batch_upload, Status(const std::vector<Path>& local_paths,
+ const std::vector<Path>& dest_paths));
+ MOCK_METHOD1(batch_delete, Status(const std::vector<Path>& paths));
+ MOCK_METHOD0(connect, Status());
+};
+
class TabletCooldownTest : public testing::Test {
public:
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());
- put_storage_resource(kResourceId, {s3_fs, 1});
+ s_fs.reset(new RemoteFileSystemMock("test_path",
std::to_string(kResourceId),
Review Comment:
warning: allocating an object of abstract class type
'doris::RemoteFileSystemMock' [clang-diagnostic-error]
```cpp
s_fs.reset(new RemoteFileSystemMock("test_path",
std::to_string(kResourceId),
^
```
**be/src/io/fs/file_system.h:66:** unimplemented pure virtual method
'exists' in 'RemoteFileSystemMock'
```cpp
virtual Status exists(const Path& path, bool* res) const = 0;
^
```
**be/src/io/fs/file_system.h:68:** unimplemented pure virtual method
'file_size' in 'RemoteFileSystemMock'
```cpp
virtual Status file_size(const Path& path, size_t* file_size) const = 0;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
Review Comment:
warning: '_file_writer' is a private member of 'doris::TabletCooldownTest'
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
^
```
**be/test/olap/tablet_cooldown_test.cpp:129:** declared private here
```cpp
static io::FileWriterPtr* _file_writer;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
Review Comment:
warning: '_file_writer' is a private member of 'doris::TabletCooldownTest'
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
^
```
**be/test/olap/tablet_cooldown_test.cpp:129:** declared private here
```cpp
static io::FileWriterPtr* _file_writer;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
+ ::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
Review Comment:
warning: member reference type 'io::FileWriterPtr *' (aka
'unique_ptr<doris::io::FileWriter> *') is a pointer; did you mean to use '->'?
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2035:** expanded
from macro 'EXPECT_CALL'
```cpp
GMOCK_ON_CALL_IMPL_(obj, InternalExpectedAt, call)
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2027:** expanded
from macro 'GMOCK_ON_CALL_IMPL_'
```cpp
((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), \
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
+ ::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
+ ::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, write_at(::testing::_,
::testing::_)).WillRepeatedly(
Review Comment:
warning: member reference type 'io::FileWriterPtr *' (aka
'unique_ptr<doris::io::FileWriter> *') is a pointer; did you mean to use '->'?
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, write_at(::testing::_,
::testing::_)).WillRepeatedly(
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2035:** expanded
from macro 'EXPECT_CALL'
```cpp
GMOCK_ON_CALL_IMPL_(obj, InternalExpectedAt, call)
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2027:** expanded
from macro 'GMOCK_ON_CALL_IMPL_'
```cpp
((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), \
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
Review Comment:
warning: annotate this function with 'override' or (rarely) 'final'
[modernize-use-override]
```suggestion
~FileWriterMock() override {}
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
+
+ MOCK_METHOD0(close, Status());
+ MOCK_METHOD0(abort, Status());
+ MOCK_METHOD1(append, Status(const Slice& data));
+ MOCK_METHOD2(appendv, Status(const Slice* data, size_t data_cnt));
+ MOCK_METHOD2(write_at, Status(size_t offset, const Slice& data));
+ MOCK_METHOD0(finalize, Status());
+ MOCK_METHOD0(bytes_appended, size_t());
+ MOCK_METHOD0(fs, io::FileSystemSPtr());
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+ RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType
type)
+ : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+ ~RemoteFileSystemMock() {}
+
+ Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+ *writer = std::make_unique<FileWriterMock>("test_path");
+ return Status::OK();
+ }
+ MOCK_METHOD3(open_file, Status(const Path& path, io::FileReaderSPtr*
reader, IOContext* io_ctx));
+ MOCK_METHOD1(delete_file, Status(const Path& path));
+ MOCK_METHOD1(create_directory, Status(const Path& path));
+ MOCK_METHOD1(delete_directory, Status(const Path& path));
+ MOCK_METHOD2(link_file, Status(const Path& src, const Path& dest));
+ MOCK_METHOD2(exists, Status(const Path& path, bool* res));
+ MOCK_METHOD2(file_size, Status(const Path& path, size_t* file_size));
Review Comment:
warning: 'doris::RemoteFileSystemMock::file_size' hides overloaded virtual
function [clang-diagnostic-overloaded-virtual]
```cpp
MOCK_METHOD2(file_size, Status(const Path& path, size_t* file_size));
^
```
**be/src/io/fs/file_system.h:68:** hidden overloaded virtual function
'doris::io::FileSystem::file_size' declared here: different qualifiers ('const'
vs unqualified)
```cpp
virtual Status file_size(const Path& path, size_t* file_size) const = 0;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
+
+ MOCK_METHOD0(close, Status());
+ MOCK_METHOD0(abort, Status());
+ MOCK_METHOD1(append, Status(const Slice& data));
+ MOCK_METHOD2(appendv, Status(const Slice* data, size_t data_cnt));
+ MOCK_METHOD2(write_at, Status(size_t offset, const Slice& data));
+ MOCK_METHOD0(finalize, Status());
+ MOCK_METHOD0(bytes_appended, size_t());
+ MOCK_METHOD0(fs, io::FileSystemSPtr());
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+ RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType
type)
+ : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+ ~RemoteFileSystemMock() {}
Review Comment:
warning: annotate this function with 'override' or (rarely) 'final'
[modernize-use-override]
```suggestion
~RemoteFileSystemMock() override {}
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
Review Comment:
warning: member reference type 'io::FileWriterPtr *' (aka
'unique_ptr<doris::io::FileWriter> *') is a pointer; did you mean to use '->'?
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2035:** expanded
from macro 'EXPECT_CALL'
```cpp
GMOCK_ON_CALL_IMPL_(obj, InternalExpectedAt, call)
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2027:** expanded
from macro 'GMOCK_ON_CALL_IMPL_'
```cpp
((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), \
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -41,21 +45,56 @@
static constexpr int64_t kResourceId = 10000;
static constexpr int64_t kStoragePolicyId = 10002;
-// remove DISABLED_ when need run this test
-#define TabletCooldownTest DISABLED_TabletCooldownTest
+using io::Path;
+
+static io::FileSystemSPtr s_fs;
+
+class FileWriterMock : public io::FileWriter {
+public:
+ FileWriterMock(Path path) : io::FileWriter(std::move(path)) {}
+ ~FileWriterMock() {}
+
+ MOCK_METHOD0(close, Status());
+ MOCK_METHOD0(abort, Status());
+ MOCK_METHOD1(append, Status(const Slice& data));
+ MOCK_METHOD2(appendv, Status(const Slice* data, size_t data_cnt));
+ MOCK_METHOD2(write_at, Status(size_t offset, const Slice& data));
+ MOCK_METHOD0(finalize, Status());
+ MOCK_METHOD0(bytes_appended, size_t());
+ MOCK_METHOD0(fs, io::FileSystemSPtr());
+};
+
+class RemoteFileSystemMock : public io::RemoteFileSystem {
+ RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType
type)
+ : RemoteFileSystem(std::move(root_path), std::move(id), type) {}
+ ~RemoteFileSystemMock() {}
+
+ Status create_file(const Path& path, io::FileWriterPtr* writer) override {
+ *writer = std::make_unique<FileWriterMock>("test_path");
+ return Status::OK();
+ }
+ MOCK_METHOD3(open_file, Status(const Path& path, io::FileReaderSPtr*
reader, IOContext* io_ctx));
+ MOCK_METHOD1(delete_file, Status(const Path& path));
+ MOCK_METHOD1(create_directory, Status(const Path& path));
+ MOCK_METHOD1(delete_directory, Status(const Path& path));
+ MOCK_METHOD2(link_file, Status(const Path& src, const Path& dest));
+ MOCK_METHOD2(exists, Status(const Path& path, bool* res));
Review Comment:
warning: 'doris::RemoteFileSystemMock::exists' hides overloaded virtual
function [clang-diagnostic-overloaded-virtual]
```cpp
MOCK_METHOD2(exists, Status(const Path& path, bool* res));
^
```
**be/src/io/fs/file_system.h:66:** hidden overloaded virtual function
'doris::io::FileSystem::exists' declared here: different qualifiers ('const' vs
unqualified)
```cpp
virtual Status exists(const Path& path, bool* res) const = 0;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
Review Comment:
warning: member reference type 'io::FileWriterPtr *' (aka
'unique_ptr<doris::io::FileWriter> *') is a pointer; did you mean to use '->'?
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2035:** expanded
from macro 'EXPECT_CALL'
```cpp
GMOCK_ON_CALL_IMPL_(obj, InternalExpectedAt, call)
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2027:** expanded
from macro 'GMOCK_ON_CALL_IMPL_'
```cpp
((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), \
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
Review Comment:
warning: no member named 'gmock_close' in
'std::unique_ptr<doris::io::FileWriter>' [clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
^
```
expanded from here
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
Review Comment:
warning: no member named 'gmock_abort' in
'std::unique_ptr<doris::io::FileWriter>' [clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
^
```
expanded from here
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
Review Comment:
warning: '_file_writer' is a private member of 'doris::TabletCooldownTest'
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
^
```
**be/test/olap/tablet_cooldown_test.cpp:129:** declared private here
```cpp
static io::FileWriterPtr* _file_writer;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
Review Comment:
warning: member reference type 'io::FileWriterPtr *' (aka
'unique_ptr<doris::io::FileWriter> *') is a pointer; did you mean to use '->'?
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2035:** expanded
from macro 'EXPECT_CALL'
```cpp
GMOCK_ON_CALL_IMPL_(obj, InternalExpectedAt, call)
^
```
**thirdparty/installed/include/gmock/gmock-spec-builders.h:2027:** expanded
from macro 'GMOCK_ON_CALL_IMPL_'
```cpp
((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), \
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
+ ::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
Review Comment:
warning: no member named 'gmock_appendv' in
'std::unique_ptr<doris::io::FileWriter>' [clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
^
```
expanded from here
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
Review Comment:
warning: no member named 'gmock_append' in
'std::unique_ptr<doris::io::FileWriter>' [clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
^
```
expanded from here
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
+ ::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
Review Comment:
warning: '_file_writer' is a private member of 'doris::TabletCooldownTest'
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
^
```
**be/test/olap/tablet_cooldown_test.cpp:129:** declared private here
```cpp
static io::FileWriterPtr* _file_writer;
^
```
##########
be/test/olap/tablet_cooldown_test.cpp:
##########
@@ -146,9 +189,44 @@
}
TEST_F(TabletCooldownTest, normal) {
+ EXPECT_CALL(_file_writer,
close()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer,
abort()).WillRepeatedly(::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, append(::testing::_)).WillRepeatedly(
+ ::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, appendv(::testing::_,
::testing::_)).WillRepeatedly(
+ ::testing::Return(Status::OK()));
+ EXPECT_CALL(_file_writer, write_at(::testing::_,
::testing::_)).WillRepeatedly(
Review Comment:
warning: '_file_writer' is a private member of 'doris::TabletCooldownTest'
[clang-diagnostic-error]
```cpp
EXPECT_CALL(_file_writer, write_at(::testing::_,
::testing::_)).WillRepeatedly(
^
```
**be/test/olap/tablet_cooldown_test.cpp:129:** declared private here
```cpp
static io::FileWriterPtr* _file_writer;
^
```
--
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]