Skip to content

Commit f2f5a0b

Browse files
committed
make with USE_GCP=1 and without USE_AWS=1 work properly
1 parent 83bdd49 commit f2f5a0b

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
@@ -487,11 +487,13 @@ int DoRegisterCloudObjects(ObjectLibrary& library, std::string const& arg) {
487487
});
488488
count++;
489489

490-
count += CloudFileSystemImpl::RegisterAwsObjects(library, arg);
491-
#ifdef USE_GCP // Only register GCP if we have it
490+
#ifdef USE_GCP
492491
count += CloudFileSystemImpl::RegisterGcpObjects(library, arg);
493492
#endif
494493

494+
#ifdef USE_AWS
495+
count += CloudFileSystemImpl::RegisterAwsObjects(library, arg);
496+
495497
// Register the Cloud Log Controllers
496498

497499
library.AddFactory<CloudLogController>(
@@ -505,6 +507,7 @@ int DoRegisterCloudObjects(ObjectLibrary& library, std::string const& arg) {
505507
return guard->get();
506508
});
507509
count++;
510+
#endif
508511

509512
return count;
510513
}

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)