Lucene - Core
  1. Lucene - Core
  2. LUCENE-3323

Maven build: Junit CWD being the same as the test output directory doesn't always work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.4, 4.0-ALPHA
    • Fix Version/s: 3.4, 4.0-ALPHA
    • Component/s: general/build
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      TestJmxIntegration.testJmxOnCoreReload(), a new test committed as part of SOLR-2623, fails on both trunk and branch_3x.

      Example output:

      java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath or 'solr/solr/conf/', cwd=/usr/home/hudson/hudson-slave/workspace/Lucene-Solr-Maven-3.x/checkout/solr/build/solr-maven/classes/test
      at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:268)
      ...

        Activity

        Steve Rowe created issue -
        Hide
        Steve Rowe added a comment - - edited

        Switch junit CWD from ${project.build.testOutputDirectory} to ${project.build.directory}/test, and sysprop tempDir from temp/ to ./, allows this test to succeed. All other tests pass too.

        Here's the patch:

        Index: dev-tools/maven/pom.xml.template
        ===================================================================
        --- dev-tools/maven/pom.xml.template    (revision 1147495)
        +++ dev-tools/maven/pom.xml.template    (working copy)
        @@ -431,9 +431,9 @@
                   <version>2.7.1</version>
                   <configuration>
                     <reportFormat>plain</reportFormat>
        -            <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
        +            <workingDirectory>${project.build.directory}/test</workingDirectory>
                     <systemPropertyVariables>
        -              <tempDir>temp</tempDir>
        +              <tempDir>.</tempDir>
                       <jetty.testMode>1</jetty.testMode>
                       <tests.codec>${tests.codec}</tests.codec>
                       <tests.directory>${tests.directory}</tests.directory>
        

        Committing shortly.

        Show
        Steve Rowe added a comment - - edited Switch junit CWD from ${project.build.testOutputDirectory } to ${project.build.directory}/test , and sysprop tempDir from temp/ to ./ , allows this test to succeed. All other tests pass too. Here's the patch: Index: dev-tools/maven/pom.xml.template =================================================================== --- dev-tools/maven/pom.xml.template (revision 1147495) +++ dev-tools/maven/pom.xml.template (working copy) @@ -431,9 +431,9 @@ <version> 2.7.1 </version> <configuration> <reportFormat> plain </reportFormat> - <workingDirectory> ${project.build.testOutputDirectory} </workingDirectory> + <workingDirectory> ${project.build.directory}/test </workingDirectory> <systemPropertyVariables> - <tempDir> temp </tempDir> + <tempDir> . </tempDir> <jetty.testMode> 1 </jetty.testMode> <tests.codec> ${tests.codec} </tests.codec> <tests.directory> ${tests.directory} </tests.directory> Committing shortly.
        sarowe committed 1147502 (1 file)
        Reviews: none

        LUCENE-3323: changed JUnit CWD from test output directory to test/ under the build directory, to enable all tests to pass

        sarowe committed 1147503 (1 file)
        Reviews: none

        LUCENE-3323: changed JUnit CWD from test output directory to test/ under the build directory, to enable all tests to pass

        Hide
        Steve Rowe added a comment -

        Committed:

        • r1147502: trunk
        • r1147503: branch_3x
        Show
        Steve Rowe added a comment - Committed: r1147502: trunk r1147503: branch_3x
        Steve Rowe made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.4 [ 12316675 ]
        Fix Version/s 4.0 [ 12314025 ]
        Resolution Fixed [ 1 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Steve Rowe
            Reporter:
            Steve Rowe
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development