Skip to content

Commit d45a696

Browse files
committed
make with USE_GCP=1 and without USE_AWS=1 work properly
1 parent 87252da commit d45a696

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

cloud/cloud_file_system.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,13 @@ int DoRegisterCloudObjects(ObjectLibrary& library, std::string const& arg) {
485485
});
486486
count++;
487487

488-
count += CloudFileSystemImpl::RegisterAwsObjects(library, arg);
489-
#ifdef USE_GCP // Only register GCP if we have it
488+
#ifdef USE_GCP
490489
count += CloudFileSystemImpl::RegisterGcpObjects(library, arg);
491490
#endif
492491

492+
#ifdef USE_AWS
493+
count += CloudFileSystemImpl::RegisterAwsObjects(library, arg);
494+
493495
// Register the Cloud Log Controllers
494496

495497
library.AddFactory<CloudLogController>(
@@ -503,6 +505,7 @@ int DoRegisterCloudObjects(ObjectLibrary& library, std::string const& arg) {
503505
return guard->get();
504506
});
505507
count++;
508+
#endif
506509

507510
return count;
508511
}

cloud/cloud_file_system_test.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// Copyright (c) 2017 Rockset
2+
#ifndef ROCKSDB_LITE
3+
4+
#ifdef USE_AWS
25

36
#include "rocksdb/cloud/cloud_file_system.h"
47

@@ -247,3 +250,25 @@ int main(int argc, char** argv) {
247250
Aws::InitAPI(Aws::SDKOptions());
248251
return RUN_ALL_TESTS();
249252
}
253+
254+
#else // USE_AWS
255+
256+
#include <stdio.h>
257+
258+
int main(int, char**) {
259+
fprintf(stderr,
260+
"SKIPPED as DBCloud is supported only when USE_AWS is defined.\n");
261+
return 0;
262+
}
263+
#endif // USE_AWS
264+
265+
#else // ROCKSDB_LITE
266+
267+
#include <stdio.h>
268+
269+
int main(int, char**) {
270+
fprintf(stderr, "SKIPPED as DBCloud is not supported in ROCKSDB_LITE\n");
271+
return 0;
272+
}
273+
274+
#endif // ROCKSDB_LITE

cloud/gcp/gcp_db_cloud_test.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ class CloudTest : public testing::Test {
7878
void Cleanup() {
7979
ASSERT_TRUE(!aenv_);
8080

81-
// check cloud credentials
82-
ASSERT_TRUE(cloud_fs_options_.credentials.HasValid().ok());
83-
8481
CloudFileSystem* afs;
8582
// create a dummy Gcp env
8683
ASSERT_OK(CloudFileSystem::NewGcpFileSystem(base_env_->GetFileSystem(),
@@ -183,8 +180,6 @@ class CloudTest : public testing::Test {
183180

184181
void OpenWithColumnFamilies(const std::vector<std::string>& cfs,
185182
std::vector<ColumnFamilyHandle*>* handles) {
186-
ASSERT_TRUE(cloud_fs_options_.credentials.HasValid().ok());
187-
188183
// Create new Gcp env
189184
CreateCloudEnv();
190185
options_.env = aenv_.get();

0 commit comments

Comments
 (0)