Skip to content

[C++] Implement generic filesystem tests for GCS #30448

@asfimport

Description

@asfimport

Once the GCS filesystem implementation is functionally complete, generic tests should be enabled for it to catch corner cases. See for example the S3 filesystem tests:

class TestS3FSGeneric : public S3TestMixin, public GenericFileSystemTest {
public:
void SetUp() override {
S3TestMixin::SetUp();
// Set up test bucket
{
Aws::S3::Model::CreateBucketRequest req;
req.SetBucket(ToAwsString("s3fs-test-bucket"));
ASSERT_OK(OutcomeToStatus(client_->CreateBucket(req)));
}
options_.ConfigureAccessKey(minio_.access_key(), minio_.secret_key());
options_.scheme = "http";
options_.endpoint_override = minio_.connect_string();
ASSERT_OK_AND_ASSIGN(s3fs_, S3FileSystem::Make(options_));
fs_ = std::make_shared<SubTreeFileSystem>("s3fs-test-bucket", s3fs_);
}
protected:
std::shared_ptr<FileSystem> GetEmptyFileSystem() override { return fs_; }
bool have_implicit_directories() const override { return true; }
bool allow_write_file_over_dir() const override { return true; }
bool allow_move_dir() const override { return false; }
bool allow_append_to_file() const override { return false; }
bool have_directory_mtimes() const override { return false; }
bool have_flaky_directory_tree_deletion() const override {
#ifdef _WIN32
// Recent Minio versions on Windows may not register deletion of all
// directories in a tree when doing a bulk delete.
return true;
#else
return false;
#endif
}
bool have_file_metadata() const override { return true; }
S3Options options_;
std::shared_ptr<S3FileSystem> s3fs_;
std::shared_ptr<FileSystem> fs_;
};
GENERIC_FS_TEST_FUNCTIONS(TestS3FSGeneric);

Reporter: Antoine Pitrou / @pitrou
Assignee: Carlos O'Ryan / @coryan

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-14924. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions