Skip to content

Commit

Permalink
Solr 9.7 → 9.8 for integration tests (solariumphp#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascorthals authored Feb 19, 2025
1 parent 354b915 commit 6adbd6d
Show file tree
Hide file tree
Showing 18 changed files with 133 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ jobs:
ref: branch_8_11
path: lucene-solr

- name: Checkout solr 9.7
- name: Checkout solr 9.8
if: matrix.solr == 9
uses: actions/checkout@v4
with:
repository: apache/solr
ref: branch_9_7
ref: branch_9_8
path: lucene-solr

- name: Start Solr ${{ matrix.solr }} in ${{ matrix.mode }} mode
run: |
chmod -R a+w lucene-solr
cd lucene-solr
patch -p1 < ../tests/Integration/Fixtures/solrconf.patch
patch -p1 < ../tests/Integration/Fixtures/schema${{ matrix.solr }}.patch
patch -p1 < ../tests/Integration/Fixtures/conf/solrconf${{ matrix.solr }}.patch
patch -p1 < ../tests/Integration/Fixtures/conf/schema${{ matrix.solr }}.patch
cd solr/server/solr/configsets/sample_techproducts_configs/conf
zip -r techproducts.zip *
cd -
Expand Down
2 changes: 2 additions & 0 deletions examples/2.7.1-extract-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require_once(__DIR__.'/init.php');
htmlHeader();

echo '<h2>Note: The <code>extraction</code> <a href="https://solr.apache.org/guide/solr/latest/configuration-guide/solr-modules.html" target="_blank">Solr Module</a> needs to be enabled to run this example!</h2>';

// create a client instance
$client = new Solarium\Client($adapter, $eventDispatcher, $config);

Expand Down
2 changes: 2 additions & 0 deletions examples/2.7.2-extract-query-extract-only.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require_once(__DIR__.'/init.php');
htmlHeader();

echo '<h2>Note: The <code>extraction</code> <a href="https://solr.apache.org/guide/solr/latest/configuration-guide/solr-modules.html" target="_blank">Solr Module</a> needs to be enabled to run this example!</h2>';

// create a client instance
$client = new Solarium\Client($adapter, $eventDispatcher, $config);

Expand Down
2 changes: 2 additions & 0 deletions examples/2.7.3.1-extract-query-generated-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require_once(__DIR__.'/init.php');
htmlHeader();

echo '<h2>Note: The <code>extraction</code> <a href="https://solr.apache.org/guide/solr/latest/configuration-guide/solr-modules.html" target="_blank">Solr Module</a> needs to be enabled to run this example!</h2>';

// create a client instance
$client = new Solarium\Client($adapter, $eventDispatcher, $config);

Expand Down
1 change: 1 addition & 0 deletions examples/2.7.3.2-extract-query-pdo-lob.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_once(__DIR__.'/init.php');
htmlHeader();

echo '<h2>Note: The <code>extraction</code> <a href="https://solr.apache.org/guide/solr/latest/configuration-guide/solr-modules.html" target="_blank">Solr Module</a> needs to be enabled to run this example!</h2>';
echo "<h2>Note: This example doesn't work in PHP &lt; 8.1.0!</h2>";
echo "<h2>Note: This example requires the PDO_SQLITE PDO driver (enabled by default in PHP)</h2>";

Expand Down
17 changes: 17 additions & 0 deletions tests/Integration/AbstractTechproductsTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,23 @@ public static function setUpBeforeClass(): void
self::$client->update($update);
}

// UTF8TEST was removed for Solr 9.8 in SOLR-17556
if (9 <= self::$solrVersion) {
$update = self::$client->createUpdate();

$utf8test = $update->createDocument();
$utf8test->setField('id', 'UTF8TEST');
$utf8test->setField('manu', 'Apache Software Foundation');
$utf8test->setField('cat', 'software');
$utf8test->setField('cat', 'search');
$utf8test->setField('features', 'êâîôû');
$utf8test->setField('price', 0.0);
$utf8test->setField('inStock', true);

$update->addDocument($utf8test);
self::$client->update($update);
}

$update = self::$client->createUpdate();
$update->addCommit(true, true);
self::$client->update($update);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index 06ac9b3d2e6..087287d2339 100644
index 1570be4870b..3eab43beead 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -86,6 +86,8 @@
Expand All @@ -11,7 +11,7 @@ index 06ac9b3d2e6..087287d2339 100644
<!-- an exact 'path' can be used instead of a 'dir' to specify a
specific jar file. This will cause a serious error to be logged
if it can't be loaded.
@@ -1008,6 +1010,39 @@
@@ -991,6 +993,39 @@

-->

Expand Down
53 changes: 53 additions & 0 deletions tests/Integration/Fixtures/conf/solrconf8.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index 360e6dbf8ee..949a0b1c5f8 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -83,6 +83,8 @@
<lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />

+ <lib dir="${solr.install.dir:../../../..}/dist"/>
+
<!-- an exact 'path' can be used instead of a 'dir' to specify a
specific jar file. This will cause a serious error to be logged
if it can't be loaded.
@@ -1040,6 +1042,39 @@

-->

+ <!-- A request handler for MLT queries.
+ -->
+ <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" />
+
+ <!-- A request handler for Facet, Highlight, and Spellcheck components
+ -->
+ <requestHandler name="/componentdemo" class="solr.SearchHandler">
+ <lst name="defaults">
+ <str name="echoParams">explicit</str>
+
+ <!-- Query settings -->
+ <str name="df">text</str>
+ <str name="defType">edismax</str>
+ <str name="qf">
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+ title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
+ </str>
+ <str name="mm">100%</str>
+ <str name="q.alt">*:*</str>
+ <str name="rows">10</str>
+ <str name="fl">*,score</str>
+
+ <str name="facet">on</str>
+ <str name="hl">on</str>
+ <str name="spellcheck">on</str>
+ </lst>
+
+ <!-- append spellchecking to our list of components -->
+ <arr name="last-components">
+ <str>spellcheck</str>
+ </arr>
+ </requestHandler>
+
<!-- Spell Check

The spell check component can return a list of alternative spelling
44 changes: 44 additions & 0 deletions tests/Integration/Fixtures/conf/solrconf9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index 17d07d3c23c..d130a823f00 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -703,6 +703,39 @@
<int name="xsltCacheLifetimeSeconds">5</int>
</requestHandler>

+ <!-- A request handler for MLT queries.
+ -->
+ <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" />
+
+ <!-- A request handler for Facet, Highlight, and Spellcheck components
+ -->
+ <requestHandler name="/componentdemo" class="solr.SearchHandler">
+ <lst name="defaults">
+ <str name="echoParams">explicit</str>
+
+ <!-- Query settings -->
+ <str name="df">text</str>
+ <str name="defType">edismax</str>
+ <str name="qf">
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+ title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
+ </str>
+ <str name="mm">100%</str>
+ <str name="q.alt">*:*</str>
+ <str name="rows">10</str>
+ <str name="fl">*,score</str>
+
+ <str name="facet">on</str>
+ <str name="hl">on</str>
+ <str name="spellcheck">on</str>
+ </lst>
+
+ <!-- append spellchecking to our list of components -->
+ <arr name="last-components">
+ <str>spellcheck</str>
+ </arr>
+ </requestHandler>
+
<!-- Spell Check

The spell check component can return a list of alternative spelling
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:
solr1:
image: solr:7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
solr7:
image: solr:7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:
solr1:
image: solr:8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
solr8:
image: solr:8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:
solr1:
image: solr:9
Expand All @@ -7,6 +6,7 @@ services:
- 8981:8983
environment:
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- SOLR_MODULES=extraction
networks:
- solr
depends_on:
Expand All @@ -15,7 +15,7 @@ services:
- zoo3
volumes:
- ../../security:/var/security
command: bash -c "docker-entrypoint.sh solr zk cp file:/var/security/security.json zk:/security.json && exec solr-foreground"
command: bash -c "docker-entrypoint.sh solr zk cp -z zoo1:2181,zoo2:2181,zoo3:2181 file:/var/security/security.json zk:/security.json && exec solr-foreground"

solr2:
image: solr:9
Expand All @@ -24,6 +24,7 @@ services:
- 8982:8983
environment:
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- SOLR_MODULES=extraction
networks:
- solr
depends_on:
Expand All @@ -36,6 +37,7 @@ services:
- 8983:8983
environment:
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- SOLR_MODULES=extraction
networks:
solr:
aliases:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: '3'
services:
solr9:
image: solr:9
ports:
- 8983:8983
environment:
- SOLR_MODULES=extraction
networks:
solr:
aliases:
Expand Down

0 comments on commit 6adbd6d

Please sign in to comment.