Skip to content

Commit

Permalink
Fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 8, 2023
1 parent 8d2eebe commit 376264b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
20 changes: 7 additions & 13 deletions cpp/src/arrow/filesystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,17 @@ if(ARROW_GCS)
Boost::system)
endif()

set(ARROW_S3_BUILD_TESTS ${ARROW_BUILD_TESTS})
if(ARROW_S3)
set(ARROW_S3_BUILD_TESTS ${ARROW_BUILD_TESTS})
get_target_property(AWS_CPP_SDK_S3_TYPE aws-cpp-sdk-s3 TYPE)
# We need to initialize AWS C++ SDK for direct use (not via
# arrow::fs::S3FileSystem) in arrow-s3fs-test if we use static AWS
# C++ SDK. Because AWS C++ SDK has internal static variables that
# aren't shared in libarrow and arrow-s3fs-test. It means that
# arrow::fs::InitializeS3() doesn't initialize AWS C++ SDK that is
# directly used in arrow-s3fs-test.
#
# But it seems that internal static variables in AWS C++ SDK are
# shared on macOS even if we link static AWS C++ SDK to both
# libarrow and arrow-s3fs-test. So we don't need to initialize AWS
# C++ SDK in arrow-s3fs-test on macOS.
if(AWS_CPP_SDK_S3_TYPE STREQUAL "STATIC_LIBRARY" AND NOT APPLE)
# We disable S3 filesystem tests with bundled (static linked) AWS
# C++ SDK because it's difficult to initialize underlying S3 library
# properly.
if(AWS_CPP_SDK_S3_TYPE STREQUAL "STATIC_LIBRARY")
set(ARROW_S3_BUILD_TESTS OFF)
endif()
else()
set(ARROW_S3_BUILD_TESTS OFF)
endif()

if(ARROW_S3_BUILD_TESTS)
Expand Down
6 changes: 0 additions & 6 deletions cpp/src/arrow/filesystem/s3fs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ class AwsTestMixin : public ::testing::Test {
// EC2 metadata endpoint
AwsTestMixin() : ec2_metadata_disabled_guard_("AWS_EC2_METADATA_DISABLED", "true") {}

void SetUp() override {
}

void TearDown() override {
}

private:
EnvVarGuard ec2_metadata_disabled_guard_;
};
Expand Down

0 comments on commit 376264b

Please sign in to comment.