Skip to content

Commit

Permalink
Solr 9.7 → 9.8 for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascorthals committed Jan 23, 2025
1 parent 425562b commit 51d82e1
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 10 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
16 changes: 16 additions & 0 deletions tests/Integration/AbstractTechproductsTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@ 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('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(false, 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,20 +1,20 @@
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 @@
<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.
@@ -1008,6 +1010,39 @@
@@ -991,6 +993,39 @@

-->

+ <!-- A request handler for MLT queries.
+ -->
+ <requestHandler name="/mlt" class="solr.MoreLikeThisHandler" />
Expand Down Expand Up @@ -49,5 +49,5 @@ index 06ac9b3d2e6..087287d2339 100644
+ </requestHandler>
+
<!-- Spell Check

The spell check component can return a list of alternative spelling
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
Expand Up @@ -7,6 +7,7 @@ services:
- 8981:8983
environment:
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- SOLR_MODULES=extraction
networks:
- solr
depends_on:
Expand All @@ -24,6 +25,7 @@ services:
- 8982:8983
environment:
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- SOLR_MODULES=extraction
networks:
- solr
depends_on:
Expand All @@ -36,6 +38,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
Expand Up @@ -4,6 +4,8 @@ services:
image: solr:9
ports:
- 8983:8983
environment:
- SOLR_MODULES=extraction
networks:
solr:
aliases:
Expand Down

0 comments on commit 51d82e1

Please sign in to comment.