[ 
https://issues.apache.org/jira/browse/MAPREDUCE-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anatoli Fomenko updated MAPREDUCE-1369:
---------------------------------------

    Status: Patch Available  (was: Open)

Please review the submitted patch.

Some details of this patch:

1. In Map/Reduce build.xml file test.classpath includes classpath which, in 
turn, includes 
{noformat}
  <property name="conf.dir" value="${basedir}/conf"/>
{noformat}

2. The template files are copied to conf.dir by the following code:
{noformat}
  <copy todir="${conf.dir}" verbose="true">
    <fileset dir="${conf.dir}" includes="**/*.template"/>
    <mapper type="glob" from="*.template" to="*"/>
  </copy>
{noformat}

3. Per the initial fix suggestion, a new property is introduced:
{noformat}
  <property name="test.conf.dir" value="${build.dir}/test/conf"/>
{noformat}
It replaces the conf.dir in the test.classpath:
{noformat}
  <path id="test.classpath">
    <pathelement location="${test.build.extraconf}"/>
    <pathelement location="${test.core.build.classes}" />
    <pathelement location="${test.src.dir}"/>
    <pathelement location="${build.dir}"/>
    <pathelement location="${build.examples}"/>
    <pathelement location="${build.tools}"/>
    <pathelement path="${clover.jar}"/>
  - <path refid="classpath"/>
  + <pathelement location="${build.classes}"/>
  + <pathelement location="${test.conf.dir}"/>
  + <path refid="ivy-common.classpath"/>
    <pathelement location="${test.mapred.build.classes}" />
    <path refid="ivy-test.classpath"/>
  </path>
{noformat} 

4. The following code is added to copy templates from conf.dit to test.conf.dir:
{noformat}
  <copy todir="${test.conf.dir}" verbose="true">
    <fileset dir="${conf.dir}" includes="**/*.template"/>
    <mapper type="glob" from="*.template" to="*"/>
  </copy>
{noformat}


> JUnit tests should never depend on anything in conf
> ---------------------------------------------------
>
>                 Key: MAPREDUCE-1369
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-1369
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: test
>            Reporter: Anatoli Fomenko
>            Assignee: Anatoli Fomenko
>            Priority: Blocker
>         Attachments: MAPREDUCE-1369.patch
>
>
> The recent change to mapred-queues.xml that causes many mapreduce tests to 
> break unless you delete conf/mapred-queues.xml out of your build tree is bad. 
> We need to make sure that nothing in conf is used in the unit tests. One 
> potential solution is to copy the templates into build/test/conf and use that 
> instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to