You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2011/05/07 11:52:48 UTC

svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/ lucene/backwards/ lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java solr/

Author: uschindler
Date: Sat May  7 09:52:47 2011
New Revision: 1100495

URL: http://svn.apache.org/viewvc?rev=1100495&view=rev
Log:
It was no longer possible to create the backwards test indexes, because they were automatically deleted directly after test and also their name was unreadable.
The method to create backwards indexes is never called for normal test runs, only when you explicitly enable the commented-out code

Modified:
    lucene/dev/trunk/   (props changed)
    lucene/dev/trunk/lucene/   (props changed)
    lucene/dev/trunk/lucene/backwards/   (props changed)
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
    lucene/dev/trunk/solr/   (props changed)

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=1100495&r1=1100494&r2=1100495&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Sat May  7 09:52:47 2011
@@ -446,8 +446,8 @@ public class TestBackwardsCompatibility 
   }
 
   public File createIndex(Random random, String dirName, boolean doCFS) throws IOException {
-
-    File indexDir = _TestUtil.getTempDir(dirName);
+    // we use a real directory name that is not cleaned up, because this method is only used to create backwards indexes:
+    File indexDir = new File(LuceneTestCase.TEMP_DIR, dirName);
     _TestUtil.rmDir(indexDir);
     Directory dir = newFSDirectory(indexDir);
     



Re: svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/ lucene/backwards/ lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java solr/

Posted by Robert Muir <rc...@gmail.com>.
On Sat, May 7, 2011 at 8:46 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> Thats fine :-)
>
> And randomness in trunk is not a problem, as we currently not produce trunk backwards indexes. This will be earliest with version 4.1 *g*
>

Well we should check branch_3x too. Because i know i backported
MockAnalyzer randomness (it does various things with payloads) and it
could have slipped into this method there, too.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/ lucene/backwards/ lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java solr/

Posted by Uwe Schindler <uw...@thetaphi.de>.
Thats fine :-)

And randomness in trunk is not a problem, as we currently not produce trunk backwards indexes. This will be earliest with version 4.1 *g*

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Robert Muir [mailto:rcmuir@gmail.com]
> Sent: Saturday, May 07, 2011 2:42 PM
> To: dev@lucene.apache.org
> Subject: Re: svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/
> lucene/backwards/
> lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
> solr/
> 
> On Sat, May 7, 2011 at 8:39 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> > I agree. We should maybe factor out the createIndex method at all to a
> separate class that also automatically ZIPs the index after creating it.
> createIndex method is not really a test, it’s a utility to produce the indexes.
> >
> > I just committed this to be able to process with merging here.
> >
> 
> oh, maybe I shouldn't have responded to your commit message... i didnt
> have any problems with what you were doing, it just reminded me of the
> issues I saw the other day!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/ lucene/backwards/ lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java solr/

Posted by Robert Muir <rc...@gmail.com>.
On Sat, May 7, 2011 at 8:39 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> I agree. We should maybe factor out the createIndex method at all to a separate class that also automatically ZIPs the index after creating it. createIndex method is not really a test, it’s a utility to produce the indexes.
>
> I just committed this to be able to process with merging here.
>

oh, maybe I shouldn't have responded to your commit message... i didnt
have any problems with what you were doing, it just reminded me of the
issues I saw the other day!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/ lucene/backwards/ lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java solr/

Posted by Uwe Schindler <uw...@thetaphi.de>.
I agree. We should maybe factor out the createIndex method at all to a separate class that also automatically ZIPs the index after creating it. createIndex method is not really a test, it’s a utility to produce the indexes.

I just committed this to be able to process with merging here.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Robert Muir [mailto:rcmuir@gmail.com]
> Sent: Saturday, May 07, 2011 2:35 PM
> To: dev@lucene.apache.org
> Subject: Re: svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/
> lucene/backwards/
> lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
> solr/
> 
> Hi Uwe,
> 
> I think we should open an issue to clean some of this up (I know i am at fault
> for some of it)
> 
> Recently, i worked with this test some and also found these problems:
> * when creating the backwards test index, we should not lowercase. the test
> expects to be able to do term-queries on upper-case terms.
> * when creating the backwards test index, I don't think we should use any
> random parameters... it should be 'fixed'. So for trunk this means dont use
> mockanalyzer but mocktokenizer only.
> 
> On Sat, May 7, 2011 at 5:52 AM,  <us...@apache.org> wrote:
> > Author: uschindler
> > Date: Sat May  7 09:52:47 2011
> > New Revision: 1100495
> >
> > URL: http://svn.apache.org/viewvc?rev=1100495&view=rev
> > Log:
> > It was no longer possible to create the backwards test indexes, because
> they were automatically deleted directly after test and also their name was
> unreadable.
> > The method to create backwards indexes is never called for normal test
> > runs, only when you explicitly enable the commented-out code
> >
> > Modified:
> >    lucene/dev/trunk/   (props changed)
> >    lucene/dev/trunk/lucene/   (props changed)
> >    lucene/dev/trunk/lucene/backwards/   (props changed)
> >
> >
> lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwards
> > Compatibility.java
> >    lucene/dev/trunk/solr/   (props changed)
> >
> > Modified:
> >
> lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwards
> > Compatibility.java
> > URL:
> > http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apac
> >
> he/lucene/index/TestBackwardsCompatibility.java?rev=1100495&r1=110049
> 4
> > &r2=1100495&view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> >
> lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwards
> > Compatibility.java (original)
> > +++
> lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackw
> > +++ ardsCompatibility.java Sat May  7 09:52:47 2011
> > @@ -446,8 +446,8 @@ public class TestBackwardsCompatibility
> >   }
> >
> >   public File createIndex(Random random, String dirName, boolean
> > doCFS) throws IOException {
> > -
> > -    File indexDir = _TestUtil.getTempDir(dirName);
> > +    // we use a real directory name that is not cleaned up, because this
> method is only used to create backwards indexes:
> > +    File indexDir = new File(LuceneTestCase.TEMP_DIR, dirName);
> >     _TestUtil.rmDir(indexDir);
> >     Directory dir = newFSDirectory(indexDir);
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: svn commit: r1100495 - in /lucene/dev/trunk: ./ lucene/ lucene/backwards/ lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java solr/

Posted by Robert Muir <rc...@gmail.com>.
Hi Uwe,

I think we should open an issue to clean some of this up (I know i am
at fault for some of it)

Recently, i worked with this test some and also found these problems:
* when creating the backwards test index, we should not lowercase. the
test expects to be able to do term-queries on upper-case terms.
* when creating the backwards test index, I don't think we should use
any random parameters... it should be 'fixed'. So for trunk this means
dont use mockanalyzer but mocktokenizer only.

On Sat, May 7, 2011 at 5:52 AM,  <us...@apache.org> wrote:
> Author: uschindler
> Date: Sat May  7 09:52:47 2011
> New Revision: 1100495
>
> URL: http://svn.apache.org/viewvc?rev=1100495&view=rev
> Log:
> It was no longer possible to create the backwards test indexes, because they were automatically deleted directly after test and also their name was unreadable.
> The method to create backwards indexes is never called for normal test runs, only when you explicitly enable the commented-out code
>
> Modified:
>    lucene/dev/trunk/   (props changed)
>    lucene/dev/trunk/lucene/   (props changed)
>    lucene/dev/trunk/lucene/backwards/   (props changed)
>    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
>    lucene/dev/trunk/solr/   (props changed)
>
> Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=1100495&r1=1100494&r2=1100495&view=diff
> ==============================================================================
> --- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original)
> +++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Sat May  7 09:52:47 2011
> @@ -446,8 +446,8 @@ public class TestBackwardsCompatibility
>   }
>
>   public File createIndex(Random random, String dirName, boolean doCFS) throws IOException {
> -
> -    File indexDir = _TestUtil.getTempDir(dirName);
> +    // we use a real directory name that is not cleaned up, because this method is only used to create backwards indexes:
> +    File indexDir = new File(LuceneTestCase.TEMP_DIR, dirName);
>     _TestUtil.rmDir(indexDir);
>     Directory dir = newFSDirectory(indexDir);
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org