Skip to content

Commit 16c9934

Browse files
committed
Tests: upgrade Solr to 4.10.4
* Resync test Solar script with django-haystack These are still not quite the same; at some point it would be nice to look into a common tool which both projects could use * Update Solr configuration script to set correct libpath for solr-cell to avoid lazy-load failures during testing as was reported on e.g. django-haystack#162
1 parent 19907be commit 16c9934

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Running a test Solr instance
114114

115115
Downloading, configuring and running Solr 4 looks like this::
116116

117-
./start-test-solr.sh
117+
./start-solr-test-server.sh
118118

119119
Running the tests
120120
~~~~~~~~~~~~~~~~~

run-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def start_solr():
13-
solr_proc = subprocess.Popen("./start-test-solr.sh",
13+
solr_proc = subprocess.Popen("./start-solr-test-server.sh",
1414
stdout=open("test-solr.stdout.log", "wb"),
1515
stderr=open("test-solr.stderr.log", "wb"))
1616

start-test-solr.sh renamed to start-solr-test-server.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
44

5-
SOLR_VERSION=4.7.2
5+
SOLR_VERSION=4.10.4
6+
7+
cd $(dirname $0)
8+
9+
export TEST_ROOT=$(pwd)
610

711
export SOLR_ARCHIVE="${SOLR_VERSION}.tgz"
812

@@ -16,17 +20,22 @@ if [ -f ${SOLR_ARCHIVE} ]; then
1620
fi
1721

1822
if [ ! -f ${SOLR_ARCHIVE} ]; then
19-
python get-solr-download-url.py $SOLR_VERSION | xargs curl -Lo $SOLR_ARCHIVE
23+
SOLR_DOWNLOAD_URL=$(python get-solr-download-url.py $SOLR_VERSION)
24+
curl -Lo $SOLR_ARCHIVE ${SOLR_DOWNLOAD_URL} || (echo "Unable to download ${SOLR_DOWNLOAD_URL}"; exit 2)
2025
fi
2126

22-
echo "Extracting Solr ${SOLR_VERSION} to solr4/"
27+
echo "Extracting Solr ${SOLR_VERSION} to `pwd`/solr4/"
2328
rm -rf solr4
2429
mkdir solr4
2530
tar -C solr4 -xf ${SOLR_ARCHIVE} --strip-components 2 solr-${SOLR_VERSION}/example
2631
tar -C solr4 -xf ${SOLR_ARCHIVE} --strip-components 1 solr-${SOLR_VERSION}/dist solr-${SOLR_VERSION}/contrib
2732

28-
echo "Configuring Solr"
33+
echo "Changing into solr4"
34+
2935
cd solr4
36+
37+
echo "Configuring Solr"
38+
3039
rm -rf example-DIH exampledocs
3140
mv solr solrsinglecoreanduseless
3241
mv multicore solr
@@ -41,6 +50,12 @@ perl -p -i -e 's|<lib dir="../../../dist/|<lib dir="../../dist/|'g solr/*/conf/s
4150
perl -p -i -e 's|<!-- A Robust Example|<!-- More like this request handler -->\n <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" />\n\n\n <!-- A Robust Example|'g solr/*/conf/solrconfig.xml
4251

4352
echo 'Starting server'
44-
# We use exec to allow process monitors like run-tests.py to correctly kill the
53+
# We use exec to allow process monitors to correctly kill the
4554
# actual Java process rather than this launcher script:
46-
exec java -Djava.awt.headless=true -Dapple.awt.UIElement=true -jar start.jar
55+
export CMD="java -Djetty.port=8983 -Djava.awt.headless=true -Dapple.awt.UIElement=true -Dsolr.install.dir=`pwd` -jar start.jar"
56+
57+
if [ -z "${BACKGROUND_SOLR}" ]; then
58+
exec $CMD
59+
else
60+
exec $CMD >/dev/null &
61+
fi

0 commit comments

Comments
 (0)