You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/14 14:16:03 UTC

[GitHub] [arrow] coryan commented on a change in pull request #11943: ARROW-14918: [C++] GcsFileSystem and listing files

coryan commented on a change in pull request #11943:
URL: https://github.com/apache/arrow/pull/11943#discussion_r768707118



##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -187,6 +193,31 @@ class GcsIntegrationTest : public ::testing::Test {
 
   std::string RandomFolderName() { return RandomChars(32) + "/"; }
 
+  struct Hierarchy {
+    std::string base_dir;
+    std::vector<FileInfo> contents;
+  };
+
+  Result<Hierarchy> CreateHierarchy(std::shared_ptr<arrow::fs::FileSystem> fs) {
+    const char* const kTestFolders[] = {
+        "a/", "a/0/", "a/0/0/", "a/1/", "a/2/",
+    };
+    auto result = Hierarchy{PreexistingBucketPath() + "a/", {}};
+    for (auto const* f : kTestFolders) {
+      const auto folder = PreexistingBucketPath() + f;
+      RETURN_NOT_OK(fs->CreateDir(folder, true));
+      result.contents.push_back(arrow::fs::Dir(folder));
+      for (int i = 0; i != 64; ++i) {
+        const auto filename = folder + "test-file-" + std::to_string(i);
+        ARROW_ASSIGN_OR_RAISE(auto w, fs->OpenOutputStream(filename, {}));
+        RETURN_NOT_OK(w->Write(filename.data(), filename.size()));
+        RETURN_NOT_OK(w->Close());

Review comment:
       Done.

##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -39,6 +39,11 @@
 
 namespace arrow {
 namespace fs {
+/// Custom comparison for FileInfo, we need this to use complex googletest matchers.

Review comment:
       I think the problem would remain `::testing::ElementsAreArray` also requires `operator==`.




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org