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