lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1674277 - in /lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util: LuceneTestCase.java RunListenerPrintReproduceInfo.java
Date Fri, 17 Apr 2015 11:21:21 GMT
Author: rmuir
Date: Fri Apr 17 11:21:21 2015
New Revision: 1674277

URL: http://svn.apache.org/r1674277
Log:
LUCENE-6432: add SuppressReproduceLine

Modified:
    lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
    lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1674277&r1=1674276&r2=1674277&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
Fri Apr 17 11:21:21 2015
@@ -344,6 +344,16 @@ public abstract class LuceneTestCase ext
     public String bugUrl();
   }
 
+  /**
+   * Suppress the default {@code reproduce with: ant test...}
+   * Your own listener can be added as needed for your build.
+   */
+  @Documented
+  @Inherited
+  @Retention(RetentionPolicy.RUNTIME)
+  @Target(ElementType.TYPE)
+  public @interface SuppressReproduceLine {}
+  
   // -----------------------------------------------------------------
   // Truly immutable fields and constants, initialized once and valid 
   // for all suites ever since.

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java?rev=1674277&r1=1674276&r2=1674277&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/RunListenerPrintReproduceInfo.java
Fri Apr 17 11:21:21 2015
@@ -57,6 +57,9 @@ public final class RunListenerPrintRepro
 
   /** A marker to print full env. diagnostics after the suite. */
   private boolean printDiagnosticsAfterClass;
+  
+  /** true if we should skip the reproduce string (diagnostics are independent) */
+  private boolean suppressReproduceLine;
 
 
   @Override
@@ -66,6 +69,7 @@ public final class RunListenerPrintRepro
     scope = LifecycleScope.SUITE;
 
     Class<?> targetClass = RandomizedContext.current().getTargetClass();
+    suppressReproduceLine = targetClass.isAnnotationPresent(LuceneTestCase.SuppressReproduceLine.class);
     testClassesRun.add(targetClass.getSimpleName());
   }
 
@@ -142,6 +146,9 @@ public final class RunListenerPrintRepro
   }
 
   private void reportAdditionalFailureInfo(final String testName) {
+    if (suppressReproduceLine) {
+      return;
+    }
     if (TEST_LINE_DOCS_FILE.endsWith(JENKINS_LARGE_LINE_DOCS_FILE)) {
       System.err.println("NOTE: download the large Jenkins line-docs file by running " +
         "'ant get-jenkins-line-docs' in the lucene directory.");



Mime
View raw message