github-actions[bot] commented on code in PR #17246: URL: https://github.com/apache/doris/pull/17246#discussion_r1122822717
########## be/test/olap/tablet_cooldown_test.cpp: ########## @@ -40,22 +42,115 @@ static StorageEngine* k_engine = nullptr; static const std::string kTestDir = "./ut_dir/tablet_cooldown_test"; static constexpr int64_t kResourceId = 10000; static constexpr int64_t kStoragePolicyId = 10002; +static constexpr int64_t kTabletId = 10005; +static constexpr int64_t kReplicaId = 10009; +static constexpr int64_t kSchemaHash = 270068377; + +using io::Path; + +static io::FileSystemSPtr s_fs; -// remove DISABLED_ when need run this test -#define TabletCooldownTest DISABLED_TabletCooldownTest class TabletCooldownTest : public testing::Test { + class FileWriterMock : public io::FileWriter { + public: + FileWriterMock(Path path) : io::FileWriter(std::move(path)) {} + + ~FileWriterMock() {} + + Status close() override { + return Status::OK(); + } + + Status abort() override { + return Status::OK(); + } + + Status append(const Slice& data) override { + return Status::OK(); + } + + Status appendv(const Slice* data, size_t data_cnt) override { + return Status::OK(); + } + + Status write_at(size_t offset, const Slice& data) override { + return Status::OK(); + } + + Status finalize() override { + return Status::OK(); + } + + size_t bytes_appended() const override { return 0; } + + io::FileSystemSPtr fs() const override { return s_fs; } + }; + + 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() override {} + + Status create_file(const Path& path, io::FileWriterPtr* writer) override { + *writer = std::make_unique<FileWriterMock>("test_path"); + return Status::OK(); + } + + Status open_file(const Path& path, io::FileReaderSPtr* reader, IOContext* io_ctx) override { + return Status::OK(); + } + + Status delete_file(const Path& path) override { + return Status::OK(); + } + + Status create_directory(const Path& path) override { + return Status::OK(); + } + + Status delete_directory(const Path& path) override { + return Status::OK(); + } + + Status link_file(const Path& src, const Path& dest) override { + return Status::OK(); + } + + Status exists(const Path& path, bool* res) const override { + return Status::OK(); + } + + Status file_size(const Path& path, size_t* file_size) const override { + return Status::OK(); + } + + Status list(const Path& path, std::vector<Path>* files) override { + return Status::OK(); + } + + Status upload(const Path& local_path, const Path& dest_path) override { + return Status::OK(); + } + + Status batch_upload(const std::vector<Path>& local_paths, + const std::vector<Path>& dest_paths) override { + return Status::OK(); + } + + Status batch_delete(const std::vector<Path>& paths) override { + return Status::OK(); + } + + Status connect() override { + return Status::OK(); + } + }; 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: calling a private constructor of class 'doris::TabletCooldownTest::RemoteFileSystemMock' [clang-diagnostic-error] ```cpp s_fs.reset(new RemoteFileSystemMock("test_path", std::to_string(kResourceId), ^ ``` **be/test/olap/tablet_cooldown_test.cpp:89:** implicitly declared private here ```cpp RemoteFileSystemMock(Path root_path, std::string&& id, io::FileSystemType type) ^ ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org