You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/08/24 15:20:16 UTC

svn commit: r988527 - in /lucene/dev/trunk: lucene/ lucene/contrib/benchmark/ lucene/src/test/org/apache/lucene/util/ solr/ solr/contrib/clustering/ solr/contrib/dataimporthandler/ solr/contrib/extraction/

Author: rmuir
Date: Tue Aug 24 13:20:15 2010
New Revision: 988527

URL: http://svn.apache.org/viewvc?rev=988527&view=rev
Log:
LUCENE-2619: improve test system (consistency of var names, args, sysprops passed to solr contribs, etc)

Modified:
    lucene/dev/trunk/lucene/build.xml
    lucene/dev/trunk/lucene/common-build.xml
    lucene/dev/trunk/lucene/contrib/benchmark/build.xml
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java
    lucene/dev/trunk/solr/build.xml
    lucene/dev/trunk/solr/common-build.xml
    lucene/dev/trunk/solr/contrib/clustering/build.xml
    lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml
    lucene/dev/trunk/solr/contrib/extraction/build.xml

Modified: lucene/dev/trunk/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/build.xml (original)
+++ lucene/dev/trunk/lucene/build.xml Tue Aug 24 13:20:15 2010
@@ -116,12 +116,12 @@
   	</sequential>
   </macrodef>
 
-  <target name="junit-backwards-sequential" if="runsequential">
+  <target name="junit-backwards-sequential" if="tests.sequential">
     <backwards-test-macro/>
   </target>
 
-  <target name="junit-backwards-parallel" unless="runsequential">
-    <parallel threadsPerProcessor="${threadsPerProcessor}">
+  <target name="junit-backwards-parallel" unless="tests.sequential">
+    <parallel threadsPerProcessor="${tests.threadspercpu}">
      <backwards-test-macro threadNum="1" threadTotal="8"/>
      <backwards-test-macro threadNum="2" threadTotal="8"/>
      <backwards-test-macro threadNum="3" threadTotal="8"/>

Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Tue Aug 24 13:20:15 2010
@@ -55,8 +55,14 @@
   <!-- default arguments to pass to JVM executing tests -->
   <property name="testmethod" value=""/>
   <property name="args" value=""/>
-  <property name="threadsPerProcessor" value="1" />
-  <property name="random.multiplier" value="1" />
+  <property name="tests.threadspercpu" value="1" />
+  <condition property="tests.sequential">
+    <or>
+      <isset property="testcase"/>
+      <equals arg1="${tests.threadspercpu}" arg2="0"/>
+    </or>
+  </condition>
+  <property name="tests.multiplier" value="1" />
   <property name="tests.codec" value="random" />
   <property name="tests.locale" value="random" />
   <property name="tests.timezone" value="random" />
@@ -124,12 +130,6 @@
   <property name="junit.excludes" value=""/>
   <property name="junit.details.formatter" value="org.apache.lucene.util.LuceneJUnitResultFormatter"/>
   <property name="junit.parallel.selector" value="org.apache.lucene.util.LuceneJUnitDividingSelector"/>
-  <condition property="runsequential">
-    <or>
-      <isset property="testcase"/>
-      <isset property="sequential-tests"/>
-    </or>
-  </condition>
 
   <property name="manifest.file" location="${common.dir}/build/MANIFEST.MF"/>
 
@@ -449,7 +449,7 @@
               <sysproperty key="tests.directory" value="${tests.directory}"/>
 	
 	      <!-- TODO: create propertyset for test properties, so each project can have its own set -->
-              <sysproperty key="random.multiplier" value="${random.multiplier}"/>
+              <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
 	      <sysproperty key="tempDir" file="@{tempDir}/@{threadNum}"/>
 
 	      <sysproperty key="lucene.version" value="${dev.version}"/>
@@ -496,12 +496,12 @@
   	<mkdir dir="${junit.output.dir}"/>
   </target>
 
-  <target name="junit-sequential" if="runsequential">
+  <target name="junit-sequential" if="tests.sequential">
     <test-macro/>
   </target>
 
-  <target name="junit-parallel" unless="runsequential">
-    <parallel threadsPerProcessor="${threadsPerProcessor}">
+  <target name="junit-parallel" unless="tests.sequential">
+    <parallel threadsPerProcessor="${tests.threadspercpu}">
      <test-macro threadNum="1" threadTotal="8"/>
      <test-macro threadNum="2" threadTotal="8"/>
      <test-macro threadNum="3" threadTotal="8"/>

Modified: lucene/dev/trunk/lucene/contrib/benchmark/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/benchmark/build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/benchmark/build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/benchmark/build.xml Tue Aug 24 13:20:15 2010
@@ -9,7 +9,7 @@
     <property name="working.dir" location="work"/>
 
     <!-- the tests have some parallel problems -->
-    <property name="runsequential" value="true"/>
+    <property name="tests.threadspercpu" value="0"/>
 
     <contrib-uptodate name="highlighter" property="highlighter.uptodate" classpath.property="highlighter.jar"/>
     <module-uptodate name="analysis/icu" jarfile="${common.dir}/../modules/analysis/build/icu/lucene-analyzers-icu-${version}.jar"

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java Tue Aug 24 13:20:15 2010
@@ -160,7 +160,7 @@ public class LuceneTestCaseJ4 {
    * A random multiplier which you should use when writing random tests:
    * multiply it by the number of iterations
    */
-  public static final int RANDOM_MULTIPLIER = Integer.parseInt(System.getProperty("random.multiplier", "1"));
+  public static final int RANDOM_MULTIPLIER = Integer.parseInt(System.getProperty("tests.multiplier", "1"));
   
   private int savedBoolMaxClauseCount;
 

Modified: lucene/dev/trunk/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/solr/build.xml (original)
+++ lucene/dev/trunk/solr/build.xml Tue Aug 24 13:20:15 2010
@@ -377,21 +377,14 @@
         description="Runs the core unit tests."
         depends="test-core, test-contrib" />
 
-  <condition property="runsequential">
-    <or>
-      <isset property="testcase"/>
-      <isset property="sequential-tests"/>
-    </or>
-  </condition>
-
   <target name="junit" depends="compileTests,junit-mkdir,junit-sequential,junit-parallel"/>
 
-  <target name="junit-sequential" if="runsequential">
+  <target name="junit-sequential" if="tests.sequential">
     <junit-macro/>
   </target>
 
-  <target name="junit-parallel" unless="runsequential">
-   <parallel threadsPerProcessor="${threadsPerProcessor}">
+  <target name="junit-parallel" unless="tests.sequential">
+   <parallel threadsPerProcessor="${tests.threadspercpu}">
     <junit-macro threadNum="1" threadTotal="8"/>
     <junit-macro threadNum="2" threadTotal="8"/>
     <junit-macro threadNum="3" threadTotal="8"/>
@@ -422,9 +415,6 @@
         </or>
       </not>
     </condition>
-    <condition property="dir.prop" value="-Dsolr.directoryFactory=solr.StandardDirectoryFactory">
-      <isset property="use.fsdir"/>
-    </condition>
     <!-- <mkdir dir="@{tempDir}/@{pattern}"/> 
        This is very loud and obnoxious. abuse touch instead for a "quiet" mkdir
     -->
@@ -443,10 +433,13 @@
       <sysproperty key="tests.codec" value="${tests.codec}"/>
       <sysproperty key="tests.locale" value="${tests.locale}"/>
       <sysproperty key="tests.timezone" value="${tests.timezone}"/>
+      <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
       <sysproperty key="jetty.insecurerandom" value="1"/>
       <sysproperty key="tempDir" file="@{tempDir}/@{threadNum}"/>
       <sysproperty key="testmethod" value="${testmethod}"/>
-      <jvmarg line="${dir.prop}"/>
+      <!-- TODO: why is this unconditionally set to "" above? disable for now
+         <jvmarg line="${dir.prop}"/>
+      -->
       <jvmarg line="${args}"/>
 
       <formatter classname="${junit.details.formatter}" usefile="false" if="junit.details"/>

Modified: lucene/dev/trunk/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/common-build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/solr/common-build.xml (original)
+++ lucene/dev/trunk/solr/common-build.xml Tue Aug 24 13:20:15 2010
@@ -42,12 +42,23 @@
   <property name="args" value="" />
 
   <!-- TODO: measure toning this down by default to 1 -->
-  <property name="threadsPerProcessor" value="2"/>
+  <property name="tests.threadspercpu" value="2"/>
+  <condition property="tests.sequential">
+    <or>
+      <isset property="testcase"/>
+      <equals arg1="${tests.threadspercpu}" arg2="0"/>
+    </or>
+  </condition>
 
+  <property name="tests.multiplier" value="1" />
   <property name="tests.codec" value="random" />
   <property name="tests.locale" value="random" />
   <property name="tests.timezone" value="random" />
 
+  <condition property="dir.prop" value="-Dsolr.directoryFactory=solr.StandardDirectoryFactory">
+    <isset property="use.fsdir"/>
+  </condition>
+
   <!-- Example directory -->
   <property name="example" value="${common-solr.dir}/example" />
   <!-- 

Modified: lucene/dev/trunk/solr/contrib/clustering/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/clustering/build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/clustering/build.xml (original)
+++ lucene/dev/trunk/solr/contrib/clustering/build.xml Tue Aug 24 13:20:15 2010
@@ -107,6 +107,16 @@
            dir="src/test/resources/"
            tempdir="${junit.output.dir}"
             >
+      <sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
+      <sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
+      <sysproperty key="tests.codec" value="${tests.codec}"/>
+      <sysproperty key="tests.locale" value="${tests.locale}"/>
+      <sysproperty key="tests.timezone" value="${tests.timezone}"/>
+      <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
+      <sysproperty key="jetty.insecurerandom" value="1"/>
+      <sysproperty key="tempDir" file="${junit.output.dir}"/>
+      <sysproperty key="testmethod" value="${testmethod}"/>
+      <jvmarg line="${args}"/>
       <formatter type="brief" usefile="false" if="junit.details"/>
       <classpath refid="test.classpath"/>
       <assertions>

Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml Tue Aug 24 13:20:15 2010
@@ -159,9 +159,16 @@
            dir="src/test/resources/"
            tempdir="${tempDir}"
            >
+      <sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
+      <sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
+      <sysproperty key="tests.codec" value="${tests.codec}"/>
+      <sysproperty key="tests.locale" value="${tests.locale}"/>
+      <sysproperty key="tests.timezone" value="${tests.timezone}"/>
+      <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
       <sysproperty key="jetty.insecurerandom" value="1"/>
       <sysproperty key="tempDir" file="${tempDir}"/>
       <sysproperty key="testmethod" value="${testmethod}"/>
+      <jvmarg line="${args}"/>
       <formatter type="brief" usefile="false" if="junit.details"/>
       <classpath refid="test.classpath"/>
       <formatter type="xml"/>
@@ -207,9 +214,16 @@
            dir="src/extras/test/resources/"
            tempdir="${tempDir}"
            >
+      <sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
+      <sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
+      <sysproperty key="tests.codec" value="${tests.codec}"/>
+      <sysproperty key="tests.locale" value="${tests.locale}"/>
+      <sysproperty key="tests.timezone" value="${tests.timezone}"/>
+      <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
       <sysproperty key="jetty.insecurerandom" value="1"/>
       <sysproperty key="tempDir" file="${tempDir}"/>
       <sysproperty key="testmethod" value="${testmethod}"/>
+      <jvmarg line="${args}"/>
       <formatter type="brief" usefile="false" if="junit.details"/>
       <classpath refid="test.extras.classpath"/>
       <assertions>

Modified: lucene/dev/trunk/solr/contrib/extraction/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/extraction/build.xml?rev=988527&r1=988526&r2=988527&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/extraction/build.xml (original)
+++ lucene/dev/trunk/solr/contrib/extraction/build.xml Tue Aug 24 13:20:15 2010
@@ -108,9 +108,16 @@
            dir="src/test/resources/"
            tempdir="${tempDir}"
            >
+      <sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
+      <sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
+      <sysproperty key="tests.codec" value="${tests.codec}"/>
+      <sysproperty key="tests.locale" value="${tests.locale}"/>
+      <sysproperty key="tests.timezone" value="${tests.timezone}"/>
+      <sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
       <sysproperty key="jetty.insecurerandom" value="1"/>
       <sysproperty key="tempDir" file="${tempDir}"/>
       <sysproperty key="testmethod" value="${testmethod}"/>
+      <jvmarg line="${args}"/>
       <formatter type="brief" usefile="false" if="junit.details"/>
       <classpath refid="test.classpath"/>
       <assertions>