mirror of https://github.com/apache/lucene.git
LUCENE-2619: improve test system (consistency of var names, args, sysprops passed to solr contribs, etc)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@988527 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a0d3646dc
commit
66d7bb2f4d
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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" />
|
||||
<!--
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue