Hadoop Common
  1. Hadoop Common
  2. HADOOP-7589

Prefer mvn test -DskipTests over mvn compile in test-patch.sh

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.23.0, 0.24.0
    • Fix Version/s: 0.23.0, 0.24.0
    • Component/s: build
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      I got a failure running test-patch with a clean .m2 directory.

      To quote Alejandro:

      The reason for this failure is because of how Maven reactor/dependency
      resolution works (IMO a bug).

      Maven reactor/dependency resolution is smart enough to create the classpath
      using the classes from all modules being built.

      However, this smartness falls short just a bit. The dependencies are
      resolved using the deepest maven phase used by current mvn invocation. If
      you are doing 'mvn compile' you don't get to the test compile phase. This
      means that the TEST classes are not resolved from the build but from the
      cache/repo.

      The solution is to run 'mvn test -DskipTests' instead 'mvn compile'. This
      will include the TEST classes from the build.

      So this is to replace mvn compile in test-patch.sh with mvn test -DskipTests

      1. HADOOP-7589-V1.patch
        4 kB
        Robert Joseph Evans

        Activity

        Robert Joseph Evans created issue -
        Robert Joseph Evans made changes -
        Field Original Value New Value
        Description I got a failure running test-patch with a clean .m2 directory.

        To quote Alejandro:
        {bq}
        The reason for this failure is because of how Maven reactor/dependency
        resolution works (IMO a bug).

        Maven reactor/dependency resolution is smart enough to create the classpath
        using the classes from all modules being built.

        However, this smartness falls short just a bit. The dependencies are
        resolved using the deepest maven phase used by current mvn invocation. If
        you are doing 'mvn compile' you don't get to the test compile phase. This
        means that the TEST classes are not resolved from the build but from the
        cache/repo.

        The solution is to run 'mvn test -DskipTests' instead 'mvn compile'. This
        will include the TEST classes from the build.
        {bq}

        So this is to replace mvn compile in test-patch.sh with mvn test -DskipTests
        I got a failure running test-patch with a clean .m2 directory.

        To quote Alejandro:
        {quote}
        The reason for this failure is because of how Maven reactor/dependency
        resolution works (IMO a bug).

        Maven reactor/dependency resolution is smart enough to create the classpath
        using the classes from all modules being built.

        However, this smartness falls short just a bit. The dependencies are
        resolved using the deepest maven phase used by current mvn invocation. If
        you are doing 'mvn compile' you don't get to the test compile phase. This
        means that the TEST classes are not resolved from the build but from the
        cache/repo.

        The solution is to run 'mvn test -DskipTests' instead 'mvn compile'. This
        will include the TEST classes from the build.
        {quote}

        So this is to replace mvn compile in test-patch.sh with mvn test -DskipTests
        Hide
        Robert Joseph Evans added a comment -

        Quick patch to replace compile with test -DskipTests

        Show
        Robert Joseph Evans added a comment - Quick patch to replace compile with test -DskipTests
        Robert Joseph Evans made changes -
        Attachment HADOOP-7589-V1.patch [ 12492106 ]
        Hide
        Robert Joseph Evans added a comment -

        This patch should apply to both trunk and 0.23.0 with no changes.

        Show
        Robert Joseph Evans added a comment - This patch should apply to both trunk and 0.23.0 with no changes.
        Robert Joseph Evans made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12492106/HADOOP-7589-V1.patch
        against trunk revision .

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

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

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/95//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12492106/HADOOP-7589-V1.patch against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/95//console This message is automatically generated.
        Hide
        Scott Carey added a comment -

        Doesn't using 'mvn test-compile' the same as 'mvn test -DskipTests' ?

        Show
        Scott Carey added a comment - Doesn't using 'mvn test-compile' the same as 'mvn test -DskipTests' ?
        Hide
        Alejandro Abdelnur added a comment -

        It looks good.

        Show
        Alejandro Abdelnur added a comment - It looks good.
        Hide
        Mahadev konar added a comment -

        I just pushed this. Thanks Bobby!

        Show
        Mahadev konar added a comment - I just pushed this. Thanks Bobby!
        Mahadev konar made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #802 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/802/)
        HADOOP-7589. Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev)

        mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928
        Files :

        • /hadoop/common/trunk/dev-support/test-patch.sh
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #802 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/802/ ) HADOOP-7589 . Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev) mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928 Files : /hadoop/common/trunk/dev-support/test-patch.sh
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #879 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/879/)
        HADOOP-7589. Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev)

        mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928
        Files :

        • /hadoop/common/trunk/dev-support/test-patch.sh
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #879 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/879/ ) HADOOP-7589 . Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev) mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928 Files : /hadoop/common/trunk/dev-support/test-patch.sh
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #812 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/812/)
        HADOOP-7589. Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev)

        mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928
        Files :

        • /hadoop/common/trunk/dev-support/test-patch.sh
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #812 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/812/ ) HADOOP-7589 . Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev) mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928 Files : /hadoop/common/trunk/dev-support/test-patch.sh
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #776 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/776/)
        HADOOP-7589. Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev)

        mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928
        Files :

        • /hadoop/common/trunk/dev-support/test-patch.sh
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #776 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/776/ ) HADOOP-7589 . Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev) mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928 Files : /hadoop/common/trunk/dev-support/test-patch.sh
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #801 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/801/)
        HADOOP-7589. Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev)

        mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928
        Files :

        • /hadoop/common/trunk/dev-support/test-patch.sh
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #801 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/801/ ) HADOOP-7589 . Prefer mvn test -DskipTests over mvn compile in test-patch.sh (Robert Evans via mahadev) mahadev : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1162928 Files : /hadoop/common/trunk/dev-support/test-patch.sh
        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        2m 42s 1 Robert Joseph Evans 29/Aug/11 18:53
        Patch Available Patch Available Resolved Resolved
        31m 28s 1 Mahadev konar 29/Aug/11 19:24
        Resolved Resolved Closed Closed
        77d 6h 26m 1 Arun C Murthy 15/Nov/11 00:50

          People

          • Assignee:
            Robert Joseph Evans
            Reporter:
            Robert Joseph Evans
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development