Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11673

Use org.junit.Assume to skip tests instead of return

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      We see the following code many times:

      TestCodec.java
          if (!ZlibFactory.isNativeZlibLoaded(conf)) {
            LOG.warn("skipped: native libs not loaded");
            return;
          }
      

      If ZlibFactory.isNativeZlibLoaded(conf) is false, the test will pass, with a warn log. I'd like to skip this test case by using org.junit.Assume.

      1. HADOOP-11673.patch
        2 kB
        Brahma Reddy Battula
      2. HADOOP-11673-001.patch
        2 kB
        Brahma Reddy Battula

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2077 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2077/)
        HADOOP-11673. Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200)

        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2077 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2077/ ) HADOOP-11673 . Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #127 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/127/)
        HADOOP-11673. Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #127 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/127/ ) HADOOP-11673 . Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #118 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/118/)
        HADOOP-11673. Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200)

        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #118 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/118/ ) HADOOP-11673 . Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2059 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2059/)
        HADOOP-11673. Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2059 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2059/ ) HADOOP-11673 . Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk #861 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/861/)
        HADOOP-11673. Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #861 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/861/ ) HADOOP-11673 . Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #127 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/127/)
        HADOOP-11673. Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200)

        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #127 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/127/ ) HADOOP-11673 . Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #7282 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7282/)
        HADOOP-11673. Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #7282 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7282/ ) HADOOP-11673 . Skip using JUnit Assume in TestCodec. (cdouglas: rev 790aa6790edbbe6cefc9f9b554169d67e47f4200) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Hide
        brahmareddy Brahma Reddy Battula added a comment -

        Thanks a lot Chris Douglas!!!!

        Show
        brahmareddy Brahma Reddy Battula added a comment - Thanks a lot Chris Douglas!!!!
        Hide
        chris.douglas Chris Douglas added a comment -

        +1 I committed this. Thanks, Brahma

        Show
        chris.douglas Chris Douglas added a comment - +1 I committed this. Thanks, Brahma
        Hide
        hadoopqa Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12703229/HADOOP-11673-001.patch
        against trunk revision 608ebd5.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 1 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. There were no new javadoc warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5881//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5881//console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12703229/HADOOP-11673-001.patch against trunk revision 608ebd5. +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5881//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5881//console This message is automatically generated.
        Hide
        brahmareddy Brahma Reddy Battula added a comment -

        Thanks a lot for taking look into this issue..Updated the patch based on your comments, Kindly review the same..

        Show
        brahmareddy Brahma Reddy Battula added a comment - Thanks a lot for taking look into this issue..Updated the patch based on your comments, Kindly review the same..
        Hide
        chris.douglas Chris Douglas added a comment -

        Is printing the warning still necessary? Could this replace the whole block with assumeTrue(ZlibFactory.isNativeZlibLoaded(conf)) ?

        Show
        chris.douglas Chris Douglas added a comment - Is printing the warning still necessary? Could this replace the whole block with assumeTrue(ZlibFactory.isNativeZlibLoaded(conf)) ?
        Hide
        hadoopqa Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12702823/HADOOP-11673.patch
        against trunk revision 1b67209.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 1 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. There were no new javadoc warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5857//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5857//console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12702823/HADOOP-11673.patch against trunk revision 1b67209. +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/5857//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/5857//console This message is automatically generated.

          People

          • Assignee:
            brahmareddy Brahma Reddy Battula
            Reporter:
            ajisakaa Akira Ajisaka
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development