Skip to content

Commit 6912e1c

Browse files
committed
Skip AzureFS tests in cpp_test.sh not test itself
1 parent 69a1a35 commit 6912e1c

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

ci/scripts/cpp_test.sh

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,43 +42,50 @@ if [ -z "${ARROW_DEBUG_MEMORY_POOL}" ]; then
4242
export ARROW_DEBUG_MEMORY_POOL=trap
4343
fi
4444

45+
exclude_tests=()
4546
ctest_options=()
47+
if ! type azurite >/dev/null 2>&1; then
48+
exclude_tests+=("arrow-azurefs-test")
49+
fi
4650
case "$(uname)" in
4751
Linux)
4852
n_jobs=$(nproc)
4953
;;
5054
Darwin)
5155
n_jobs=$(sysctl -n hw.ncpu)
5256
# TODO: https://github.com/apache/arrow/issues/40410
53-
exclude_tests="arrow-s3fs-test"
54-
ctest_options+=(--exclude-regex "${exclude_tests}")
57+
exclude_tests+=("arrow-s3fs-test")
5558
;;
5659
MINGW*)
5760
n_jobs=${NUMBER_OF_PROCESSORS:-1}
5861
# TODO: Enable these crashed tests.
5962
# https://issues.apache.org/jira/browse/ARROW-9072
60-
exclude_tests="gandiva-binary-test"
61-
exclude_tests="${exclude_tests}|gandiva-boolean-expr-test"
62-
exclude_tests="${exclude_tests}|gandiva-date-time-test"
63-
exclude_tests="${exclude_tests}|gandiva-decimal-single-test"
64-
exclude_tests="${exclude_tests}|gandiva-decimal-test"
65-
exclude_tests="${exclude_tests}|gandiva-filter-project-test"
66-
exclude_tests="${exclude_tests}|gandiva-filter-test"
67-
exclude_tests="${exclude_tests}|gandiva-hash-test"
68-
exclude_tests="${exclude_tests}|gandiva-if-expr-test"
69-
exclude_tests="${exclude_tests}|gandiva-in-expr-test"
70-
exclude_tests="${exclude_tests}|gandiva-internals-test"
71-
exclude_tests="${exclude_tests}|gandiva-literal-test"
72-
exclude_tests="${exclude_tests}|gandiva-null-validity-test"
73-
exclude_tests="${exclude_tests}|gandiva-precompiled-test"
74-
exclude_tests="${exclude_tests}|gandiva-projector-test"
75-
exclude_tests="${exclude_tests}|gandiva-utf8-test"
76-
ctest_options+=(--exclude-regex "${exclude_tests}")
63+
exclude_tests+=("gandiva-binary-test")
64+
exclude_tests+=("gandiva-boolean-expr-test")
65+
exclude_tests+=("gandiva-date-time-test")
66+
exclude_tests+=("gandiva-decimal-single-test")
67+
exclude_tests+=("gandiva-decimal-test")
68+
exclude_tests+=("gandiva-filter-project-test")
69+
exclude_tests+=("gandiva-filter-test")
70+
exclude_tests+=("gandiva-hash-test")
71+
exclude_tests+=("gandiva-if-expr-test")
72+
exclude_tests+=("gandiva-in-expr-test")
73+
exclude_tests+=("gandiva-internals-test")
74+
exclude_tests+=("gandiva-literal-test")
75+
exclude_tests+=("gandiva-null-validity-test")
76+
exclude_tests+=("gandiva-precompiled-test")
77+
exclude_tests+=("gandiva-projector-test")
78+
exclude_tests+=("gandiva-utf8-test")
7779
;;
7880
*)
7981
n_jobs=${NPROC:-1}
8082
;;
8183
esac
84+
if [ "${#exclude_tests[@]}" -gt 0 ]; then
85+
IFS="|"
86+
ctest_options+=(--exclude-regex "${exclude_tests[*]}")
87+
unset IFS
88+
fi
8289

8390
if [ "${ARROW_EMSCRIPTEN:-OFF}" = "ON" ]; then
8491
n_jobs=1 # avoid spurious fails on emscripten due to loading too many big executables

cpp/src/arrow/filesystem/azurefs_test.cc

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,8 @@ class TestGeneric : public ::testing::Test, public GenericFileSystemTest {
423423
class TestAzuriteGeneric : public TestGeneric {
424424
public:
425425
void SetUp() override {
426-
auto env_result = AzuriteEnv::GetInstance();
427-
if (!env_result.ok()) {
428-
GTEST_SKIP() << "Failed to setup: " << env_result.status().ToString();
429-
}
430-
SetUpInternal(*env_result);
426+
ASSERT_OK_AND_ASSIGN(auto env, AzuriteEnv::GetInstance());
427+
SetUpInternal(env);
431428
}
432429

433430
protected:
@@ -891,13 +888,9 @@ class TestAzureFileSystem : public ::testing::Test {
891888
}
892889

893890
void SetUp() override {
894-
auto env_result = GetAzureEnv();
895-
if (!env_result.ok()) {
896-
GTEST_SKIP() << "Failed to setup: " << env_result.status().ToString();
897-
}
898-
auto env = *env_result;
899-
EXPECT_THAT(env, NotNull());
900-
auto make_options = [this, &env]() -> Result<AzureOptions> {
891+
auto make_options = [this]() -> Result<AzureOptions> {
892+
ARROW_ASSIGN_OR_RAISE(auto env, GetAzureEnv());
893+
EXPECT_THAT(env, NotNull());
901894
ARROW_ASSIGN_OR_RAISE(debug_log_start_, env->GetDebugLogSize());
902895
return MakeOptions(env);
903896
};

0 commit comments

Comments
 (0)