From c0208b464cfee48e9c22c1b5a599c89cf60b9a3b Mon Sep 17 00:00:00 2001 From: thomascorthals Date: Wed, 22 Jan 2025 19:33:25 +0100 Subject: [PATCH] =?UTF-8?q?Solr=209.7=20=E2=86=92=209.8=20for=20integratio?= =?UTF-8?q?n=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run-tests.yml | 8 +-- .../AbstractTechproductsTestCase.php | 31 +++++++++++ .../Fixtures/{ => conf}/schema7.patch | 0 .../Fixtures/{ => conf}/schema8.patch | 0 .../Fixtures/{ => conf}/schema9.patch | 0 .../{solrconf.patch => conf/solrconf7.patch} | 12 ++--- .../Integration/Fixtures/conf/solrconf8.patch | 53 +++++++++++++++++++ .../Integration/Fixtures/conf/solrconf9.patch | 44 +++++++++++++++ .../docker/solr7_cloud/docker-compose.yml | 1 - .../docker/solr7_server/docker-compose.yml | 1 - .../docker/solr8_cloud/docker-compose.yml | 1 - .../docker/solr8_server/docker-compose.yml | 1 - .../docker/solr9_cloud/docker-compose.yml | 4 +- .../docker/solr9_server/docker-compose.yml | 3 +- 14 files changed, 143 insertions(+), 16 deletions(-) rename tests/Integration/Fixtures/{ => conf}/schema7.patch (100%) rename tests/Integration/Fixtures/{ => conf}/schema8.patch (100%) rename tests/Integration/Fixtures/{ => conf}/schema9.patch (100%) rename tests/Integration/Fixtures/{solrconf.patch => conf/solrconf7.patch} (96%) create mode 100644 tests/Integration/Fixtures/conf/solrconf8.patch create mode 100644 tests/Integration/Fixtures/conf/solrconf9.patch diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bbf78b6d5..0eedaed4c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 - diff --git a/tests/Integration/AbstractTechproductsTestCase.php b/tests/Integration/AbstractTechproductsTestCase.php index 4ae7ed9ed..99f733bc9 100644 --- a/tests/Integration/AbstractTechproductsTestCase.php +++ b/tests/Integration/AbstractTechproductsTestCase.php @@ -172,6 +172,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(false, true); self::$client->update($update); @@ -4953,6 +4970,13 @@ public function testManagedStopwords() */ public function testManagedStopwordsCreation(string $name, string $term) { + // this test triggers an error for Solr 9.8 in SolrCloud mode + if (9 === self::$solrVersion && $this instanceof AbstractCloudTestCase) { + $this->expectNotToPerformAssertions(); + + return; + } + // don't use invalid filename characters in list name on Windows to avoid running into SOLR-15895 if (self::$isSolrOnWindows) { $name = str_replace([':', '/', '?'], '', $name); @@ -5118,6 +5142,13 @@ public function testManagedSynonyms() */ public function testManagedSynonymsCreation(string $name, string $term) { + // this test triggers an error for Solr 9.8 in SolrCloud mode + if (9 === self::$solrVersion && $this instanceof AbstractCloudTestCase) { + $this->expectNotToPerformAssertions(); + + return; + } + // don't use invalid filename characters in map name on Windows to avoid running into SOLR-15895 if (self::$isSolrOnWindows) { $name = str_replace([':', '/', '?'], '', $name); diff --git a/tests/Integration/Fixtures/schema7.patch b/tests/Integration/Fixtures/conf/schema7.patch similarity index 100% rename from tests/Integration/Fixtures/schema7.patch rename to tests/Integration/Fixtures/conf/schema7.patch diff --git a/tests/Integration/Fixtures/schema8.patch b/tests/Integration/Fixtures/conf/schema8.patch similarity index 100% rename from tests/Integration/Fixtures/schema8.patch rename to tests/Integration/Fixtures/conf/schema8.patch diff --git a/tests/Integration/Fixtures/schema9.patch b/tests/Integration/Fixtures/conf/schema9.patch similarity index 100% rename from tests/Integration/Fixtures/schema9.patch rename to tests/Integration/Fixtures/conf/schema9.patch diff --git a/tests/Integration/Fixtures/solrconf.patch b/tests/Integration/Fixtures/conf/solrconf7.patch similarity index 96% rename from tests/Integration/Fixtures/solrconf.patch rename to tests/Integration/Fixtures/conf/solrconf7.patch index 4b9ce49cd..eb290bacf 100644 --- a/tests/Integration/Fixtures/solrconf.patch +++ b/tests/Integration/Fixtures/conf/solrconf7.patch @@ -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 @@ - + + + - + + + @@ -49,5 +49,5 @@ index 06ac9b3d2e6..087287d2339 100644 + + + ++ ++ ++ ++ ++ ++ ++ explicit ++ ++ ++ text ++ edismax ++ ++ 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 ++ ++ 100% ++ *:* ++ 10 ++ *,score ++ ++ on ++ on ++ on ++ ++ ++ ++ ++ spellcheck ++ ++ ++ + ++ ++ ++ ++ ++ ++ explicit ++ ++ ++ text ++ edismax ++ ++ 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 ++ ++ 100% ++ *:* ++ 10 ++ *,score ++ ++ on ++ on ++ on ++ ++ ++ ++ ++ spellcheck ++ ++ ++ +