lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwe...@apache.org
Subject svn commit: r1539106 - in /lucene/dev/trunk: dev-tools/idea/.idea/libraries/ lucene/ lucene/analysis/ lucene/licenses/ solr/ solr/licenses/
Date Tue, 05 Nov 2013 19:20:08 GMT
Author: dweiss
Date: Tue Nov  5 19:20:07 2013
New Revision: 1539106

URL: http://svn.apache.org/r1539106
Log:
LUCENE-5283: Fail the build if ant test didn't execute any tests (everything filtered out).


Added:
    lucene/dev/trunk/lucene/licenses/junit4-ant-2.0.13.jar.sha1   (with props)
    lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.0.13.jar.sha1   (with props)
    lucene/dev/trunk/solr/licenses/junit4-ant-2.0.13.jar.sha1   (with props)
    lucene/dev/trunk/solr/licenses/randomizedtesting-runner-2.0.13.jar.sha1   (with props)
Removed:
    lucene/dev/trunk/lucene/licenses/junit4-ant-2.0.12.jar.sha1
    lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.0.12.jar.sha1
    lucene/dev/trunk/solr/licenses/junit4-ant-2.0.12.jar.sha1
    lucene/dev/trunk/solr/licenses/randomizedtesting-runner-2.0.12.jar.sha1
Modified:
    lucene/dev/trunk/dev-tools/idea/.idea/libraries/JUnit.xml
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/analysis/build.xml
    lucene/dev/trunk/lucene/build.xml
    lucene/dev/trunk/lucene/common-build.xml
    lucene/dev/trunk/lucene/ivy-versions.properties
    lucene/dev/trunk/solr/build.xml

Modified: lucene/dev/trunk/dev-tools/idea/.idea/libraries/JUnit.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/idea/.idea/libraries/JUnit.xml?rev=1539106&r1=1539105&r2=1539106&view=diff
==============================================================================
--- lucene/dev/trunk/dev-tools/idea/.idea/libraries/JUnit.xml (original)
+++ lucene/dev/trunk/dev-tools/idea/.idea/libraries/JUnit.xml Tue Nov  5 19:20:07 2013
@@ -2,7 +2,7 @@
   <library name="JUnit">
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lucene/test-framework/lib/junit-4.10.jar!/" />
-      <root url="jar://$PROJECT_DIR$/lucene/test-framework/lib/randomizedtesting-runner-2.0.12.jar!/"
/>
+      <root url="jar://$PROJECT_DIR$/lucene/test-framework/lib/randomizedtesting-runner-2.0.13.jar!/"
/>
     </CLASSES>
     <JAVADOC />
     <SOURCES />

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1539106&r1=1539105&r2=1539106&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Tue Nov  5 19:20:07 2013
@@ -262,6 +262,9 @@ Changes in backwards compatibility polic
 
 Build
 
+* LUCENE-5283: Fail the build if ant test didn't execute any tests 
+  (everything filtered out). (Dawid Weiss)
+
 * LUCENE-5249, LUCENE-5257: All Lucene/Solr modules should use the same
   dependency versions. (Steve Rowe)
   

Modified: lucene/dev/trunk/lucene/analysis/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/build.xml?rev=1539106&r1=1539105&r2=1539106&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/build.xml (original)
+++ lucene/dev/trunk/lucene/analysis/build.xml Tue Nov  5 19:20:07 2013
@@ -46,6 +46,7 @@
     <propertyref regex=".*\.uptodate$$"/>
     <propertyref regex=".*\.compiled$$"/>
     <propertyref regex=".*\.loaded$$"/>
+    <propertyref name="tests.totals.tmpfile" />
   </propertyset>
 
   <target name="common">

Modified: lucene/dev/trunk/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/build.xml?rev=1539106&r1=1539105&r2=1539106&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/build.xml (original)
+++ lucene/dev/trunk/lucene/build.xml Tue Nov  5 19:20:07 2013
@@ -52,7 +52,7 @@
   </target>
 
   <!-- "-clover.load" is *not* a useless dependency. do not remove -->
-  <target name="test" depends="-clover.load, test-core, test-modules, test-backwards"
+  <target name="test" depends="-clover.load, -init-totals, test-core, test-modules, test-backwards,
-check-totals"
           description="Runs all unit tests (core, modules and back-compat)"
   />
 

Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1539106&r1=1539105&r2=1539106&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Tue Nov  5 19:20:07 2013
@@ -263,6 +263,7 @@
     <propertyref regex=".*\.compiled$$"/>
     <propertyref regex=".*\.loaded$$"/>
     <propertyref name="lucene.javadoc.url"/><!-- for Solr -->
+    <propertyref name="tests.totals.tmpfile" />
   </propertyset>
 
   <patternset id="lucene.local.src.package.patterns"
@@ -880,12 +881,16 @@
         <property name="tests.caches" location="${common.dir}/tools/junit4" /> <!--
defaults -->
         <mkdir dir="${tests.cachedir}/${name}" />
 
+        <local name="junit4.stats.nonIgnored" />
+
         <junit4:junit4
             taskName="junit4"
             dir="@{workDir}"
             tempdir="@{workDir}/temp"
-            maxmemory="${tests.heapsize}" 
-            
+            maxmemory="${tests.heapsize}"
+
+            statsPropertyPrefix="junit4.stats"
+
             parallelism="@{threadNum}"
 
             printSummary="true"
@@ -1035,7 +1040,7 @@
                   </junit4:filtertrace>                    
                 </junit4:report-text>
 
-                <!-- Emits full status for all tests, their relative order on slaves.
-->
+                <!-- Emits full status for all tests, their relative order on forked JVMs.
-->
                 <junit4:report-text
                     file="@{junit.output.dir}/tests-report.txt"
                     showThrowable="true" 
@@ -1090,6 +1095,9 @@
             </junit4:duplicate>
         </junit4:junit4>
 
+        <!-- Append the number of non-ignored (actually executed) tests. -->
+        <echo file="${tests.totals.tmpfile}" append="true" encoding="UTF-8"># module:
${ant.project.name}&#x000a;${junit4.stats.nonIgnored}&#x000a;</echo>
+
         <!-- Report the 5 slowest tests from this run to the console. -->
         <echo>5 slowest tests:</echo>
         <junit4:tophints max="5">
@@ -1254,11 +1262,47 @@ ${tests-output}/junit4-*.suites     - pe
 
   <!-- note: order here is important, the taskdef depends on test-framework
        jars so we just order it after compile-test to ensure that -->
-  <target name="test" depends="clover,compile-test,install-junit4-taskdef,validate" description="Runs
unit tests">
+  <target name="test" depends="clover,compile-test,install-junit4-taskdef,validate,-init-totals,-test,-check-totals"
description="Runs unit tests">
+  </target>
+
+  <!-- Run the actual tests (must be wrapped with -init-totals, -check-totals) -->
+  <target name="-test">
     <mkdir dir="${junit.output.dir}"/>
     <test-macro threadNum="${tests.jvms.override}" />
   </target>
 
+  <target name="-check-totals" if="tests.totals.toplevel">
+    <!-- We are concluding a test pass at the outermost level. Sum up all executed tests.
-->
+    <local name="tests.totals.content" />
+    <loadfile srcFile="${tests.totals.tmpfile}" encoding="UTF-8" property="tests.totals.content"
quiet="true" />
+    <fail message="Not even a single test was executed (a typo in the filter pattern maybe)?">
+      <condition>
+        <scriptcondition language="javascript"><![CDATA[
+          var lines = ("" + project.getProperty("tests.totals.content")).split(/\n/);
+          var total = 0;
+          for (var i = 0; i < lines.length; i++) {
+            if (/^[0-9]+/.test(lines[i])) {
+              total += parseInt(lines[i]);
+            }
+          }
+          self.setValue(total == 0);
+        ]]></scriptcondition>
+      </condition>
+    </fail>
+  </target>
+
+  <target name="-init-totals" unless="tests.totals.tmpfile">
+    <echo>## TOTALS: init</echo>
+
+    <tempfile property="tests.totals.tmpfile"
+              destdir="${basedir}"
+              prefix=".test-totals-"
+              suffix=".tmp"
+              deleteonexit="true"
+              createfile="true" />
+    <property name="tests.totals.toplevel" value="true" />
+  </target>
+
   <!--
    See http://issues.apache.org/jira/browse/LUCENE-721
    -->

Modified: lucene/dev/trunk/lucene/ivy-versions.properties
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/ivy-versions.properties?rev=1539106&r1=1539105&r2=1539106&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/ivy-versions.properties (original)
+++ lucene/dev/trunk/lucene/ivy-versions.properties Tue Nov  5 19:20:07 2013
@@ -4,7 +4,7 @@
 
 /cglib/cglib-nodep = 2.2
 
-com.carrotsearch.randomizedtesting.version = 2.0.12
+com.carrotsearch.randomizedtesting.version = 2.0.13
 /com.carrotsearch.randomizedtesting/junit4-ant = ${com.carrotsearch.randomizedtesting.version}
 /com.carrotsearch.randomizedtesting/randomizedtesting-runner = ${com.carrotsearch.randomizedtesting.version}
 

Added: lucene/dev/trunk/lucene/licenses/junit4-ant-2.0.13.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/licenses/junit4-ant-2.0.13.jar.sha1?rev=1539106&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/licenses/junit4-ant-2.0.13.jar.sha1 (added)
+++ lucene/dev/trunk/lucene/licenses/junit4-ant-2.0.13.jar.sha1 Tue Nov  5 19:20:07 2013
@@ -0,0 +1 @@
+33904a47c5f920d270437ea1075cc9fa5ecb8099

Added: lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.0.13.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.0.13.jar.sha1?rev=1539106&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.0.13.jar.sha1 (added)
+++ lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.0.13.jar.sha1 Tue Nov  5 19:20:07
2013
@@ -0,0 +1 @@
+bdacac985583621c50de414b1d45b1e6e43f6d1f

Modified: lucene/dev/trunk/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/build.xml?rev=1539106&r1=1539105&r2=1539106&view=diff
==============================================================================
--- lucene/dev/trunk/solr/build.xml (original)
+++ lucene/dev/trunk/solr/build.xml Tue Nov  5 19:20:07 2013
@@ -130,7 +130,7 @@
           depends="compile-core, compile-contrib"/>
 
   <target name="test" description="Validate, then run core, solrj, and contrib unit tests."
-          depends="test-core, test-contrib"/>
+          depends="-init-totals, test-core, test-contrib, -check-totals"/>
   <!-- "-clover.load" is *not* a useless dependency. do not remove -->
   <target name="test-core" description="Runs the core and solrj unit tests."
           depends="-clover.load, test-solr-core, test-solrj"/>

Added: lucene/dev/trunk/solr/licenses/junit4-ant-2.0.13.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/licenses/junit4-ant-2.0.13.jar.sha1?rev=1539106&view=auto
==============================================================================
--- lucene/dev/trunk/solr/licenses/junit4-ant-2.0.13.jar.sha1 (added)
+++ lucene/dev/trunk/solr/licenses/junit4-ant-2.0.13.jar.sha1 Tue Nov  5 19:20:07 2013
@@ -0,0 +1 @@
+33904a47c5f920d270437ea1075cc9fa5ecb8099

Added: lucene/dev/trunk/solr/licenses/randomizedtesting-runner-2.0.13.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/licenses/randomizedtesting-runner-2.0.13.jar.sha1?rev=1539106&view=auto
==============================================================================
--- lucene/dev/trunk/solr/licenses/randomizedtesting-runner-2.0.13.jar.sha1 (added)
+++ lucene/dev/trunk/solr/licenses/randomizedtesting-runner-2.0.13.jar.sha1 Tue Nov  5 19:20:07
2013
@@ -0,0 +1 @@
+bdacac985583621c50de414b1d45b1e6e43f6d1f



Mime
View raw message