You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Erick Erickson <er...@gmail.com> on 2013/08/24 20:29:40 UTC

Testing and default solr.xml

I need some opinions here. SOLR-4817 is removing the hard-coded solr.xml
file for trunk. It took about 1/2 hour to change the code and a day to
struggle with tests.

The problem is that there are a number of places that start up some kind of
server from a place in the source tree. DistributedClusteringComponentTest
is a case-in-point. This code:
 public String getSolrHome() {
    return getFile("clustering/solr/collection1").getParent();
  }

looks like it gets solrHome from the source tree, some place like:
/Users/Erick/apache/trunk_4817/solr/contrib/clustering/src/test-files/clustering/solr/collection1/

The problem is there's no solr.xml
in /Users/Erick/apache/trunk_4817/solr/contrib/clustering/src/test-files/clustering/solr,
the default hard-coded in ConfigSolrXmlOld.java is used. All well and good.

But in order to remove the hard-coded solr.xml, a solr.xml file needs to be
in solrHome, and I can't write it to
/Users/Erick/apache/trunk_4817/solr/contrib/clustering/src/test-files/clustering/solr,
since it's in the source tree (and huge thanks to whoever put the stuff in
that prevents me unknowingly copying stuff there from tests!).

So there are two ways to deal with this.

1> create a temporary directory, copy all the stuff from
/Users/Erick/apache/trunk_4817/solr/contrib/clustering/src/test-files/clustering/solr
over there and add in solr.xml

2> just put a copy of solr.xml that was hard-coded in ConfigSolrXmlOld in
 /Users/Erick/apache/trunk_4817/solr/contrib/clustering/src/test-files/clustering/solr
and check it in.

It could be argued that <1> is "more correct" since we shouldn't really be
running a test out of the source tree.

What are the opinions out there? Personally I'm getting this horrible
sinking feeling in my stomach at the number of tests I'm needing to touch.
It seems fairly risky to change all these. I think I prefer just adding a
copy of solr.xml into the source tree wherever it's referenced. That seems
coherent in that if a contrib or whatever is using its own conf tree, then
putting solr.xml at the root of that conf seems reasonable.

Thoughts?

Erick

Re: Testing and default solr.xml

Posted by Erick Erickson <er...@gmail.com>.
Right, but I'm having to touch an awful lot of test cases and it's making
me nervous is all. Whenever the complexification explodes like this I
wonder if I'm missing something obvious.

Sometimes it's as simple as copying the solr.xml to the place that the test
is set up in the initialization for the test
(TestSolrEntityProcessorEndToEnd is a case in point).

And it's not as simple as I thought, unfortunately. I suspect now that
there's only a few cases that really run from the directory in the source
tree. Many of the rest copy the files from the source tree to a temporary
directory and use that temp dir as solrHome.

It looks like the right thing to do is copy files to a temp dir since
that's what's done in most cases and bring the outliers into line and do
the same thing. At the same time we can copy the old-style solr.xml into
solrHome and things will work.




On Sat, Aug 24, 2013 at 2:37 PM, Robert Muir <rc...@gmail.com> wrote:

> On Sat, Aug 24, 2013 at 2:29 PM, Erick Erickson <er...@gmail.com>
> wrote:
> >
> > What are the opinions out there? Personally I'm getting this horrible
> > sinking feeling in my stomach at the number of tests I'm needing to
> touch.
>
> Well its not most tests right: only the ones that spin up jetty, use
> the example directories, and do other crazy things
>
> Most tests should be unaffected since they are using the simple
> solr.xml config in TestHarness.getTestHarnessConfig right?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Testing and default solr.xml

Posted by Robert Muir <rc...@gmail.com>.
On Sat, Aug 24, 2013 at 2:29 PM, Erick Erickson <er...@gmail.com> wrote:
>
> What are the opinions out there? Personally I'm getting this horrible
> sinking feeling in my stomach at the number of tests I'm needing to touch.

Well its not most tests right: only the ones that spin up jetty, use
the example directories, and do other crazy things

Most tests should be unaffected since they are using the simple
solr.xml config in TestHarness.getTestHarnessConfig right?

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