This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new bef5876f05 MINOR: [C++][Parquet] Fix test failure when codec is 
disabled (#34179)
bef5876f05 is described below

commit bef5876f05024dfc492caa12213d909b3a4a663e
Author: Gang Wu <[email protected]>
AuthorDate: Wed Feb 15 11:26:19 2023 +0800

    MINOR: [C++][Parquet] Fix test failure when codec is disabled (#34179)
    
    ### Rationale for this change
    
    When parquet-cpp was built without any codec enabled, some test cases fail 
like below:
    ```
    cmake .. -DCMAKE_BUILD_TYPE=Debug \
             -DARROW_PARQUET=ON \
             -DARROW_BUILD_TESTS=ON \
             -DARROW_WITH_ZLIB=OFF \
             -DARROW_WITH_ZSTD=OFF \
             -DARROW_WITH_SNAPPY=OFF
    
    ctest -j16 --output-on-failure
    
    [----------] Global test environment tear-down
    [==========] 110 tests from 31 test suites ran. (697 ms total)
    [  PASSED  ] 104 tests.
    [  SKIPPED ] 1 test, listed below:
    [  SKIPPED ] TestDumpWithLocalFile.DumpOutput
    [  FAILED  ] 5 tests, listed below:
    [  FAILED  ] TestBooleanRLE.TestBooleanScanner
    [  FAILED  ] TestBooleanRLE.TestBatchRead
    [  FAILED  ] TestTextDeltaLengthByteArray.TestTextScanner
    [  FAILED  ] TestTextDeltaLengthByteArray.TestBatchRead
    [  FAILED  ] TestCheckDataPageCrc.SnappyPageV1
    ```
    
    ### What changes are included in this PR?
    
    Protect the failed test cases with macros to avoid failure.
    
    ### Are these changes tested?
    
    Make sure all unit tests pass.
    
    ### Are there any user-facing changes?
    
    No
    
    Authored-by: Gang Wu <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/parquet/reader_test.cc | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/cpp/src/parquet/reader_test.cc b/cpp/src/parquet/reader_test.cc
index f2003242de..fab8d88620 100644
--- a/cpp/src/parquet/reader_test.cc
+++ b/cpp/src/parquet/reader_test.cc
@@ -157,6 +157,9 @@ class TestBooleanRLE : public ::testing::Test {
 };
 
 TEST_F(TestBooleanRLE, TestBooleanScanner) {
+#ifndef ARROW_WITH_ZLIB
+  GTEST_SKIP() << "Test requires Zlib compression";
+#endif
   int nvalues = 68;
   int validation_values = 16;
 
@@ -204,6 +207,9 @@ TEST_F(TestBooleanRLE, TestBooleanScanner) {
 }
 
 TEST_F(TestBooleanRLE, TestBatchRead) {
+#ifndef ARROW_WITH_ZLIB
+  GTEST_SKIP() << "Test requires Zlib compression";
+#endif
   int nvalues = 68;
   int num_row_groups = 1;
   int metadata_size = 111;
@@ -278,6 +284,9 @@ class TestTextDeltaLengthByteArray : public ::testing::Test 
{
 };
 
 TEST_F(TestTextDeltaLengthByteArray, TestTextScanner) {
+#ifndef ARROW_WITH_ZSTD
+  GTEST_SKIP() << "Test requires Zstd compression";
+#endif
   auto group = reader_->RowGroup(0);
 
   // column 0, id
@@ -299,6 +308,9 @@ TEST_F(TestTextDeltaLengthByteArray, TestTextScanner) {
 }
 
 TEST_F(TestTextDeltaLengthByteArray, TestBatchRead) {
+#ifndef ARROW_WITH_ZSTD
+  GTEST_SKIP() << "Test requires Zstd compression";
+#endif
   auto group = reader_->RowGroup(0);
 
   // column 0, id
@@ -635,14 +647,15 @@ TEST_F(TestCheckDataPageCrc, UncompressedPageV1) {
                   /*page_checksum_verification=*/true);
 }
 
-#ifndef ARROW_WITH_SNAPPY
 TEST_F(TestCheckDataPageCrc, SnappyPageV1) {
+#ifndef ARROW_WITH_SNAPPY
+  GTEST_SKIP() << "Test requires Snappy compression";
+#endif
   CheckCorrectCrc(data_page_v1_snappy_checksum(),
                   /*page_checksum_verification=*/false);
   CheckCorrectCrc(data_page_v1_snappy_checksum(),
                   /*page_checksum_verification=*/true);
 }
-#endif
 
 TEST(TestFileReaderAdHoc, NationDictTruncatedDataPage) {
   // PARQUET-816. Some files generated by older Parquet implementations may

Reply via email to