diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 01fcaea3..e13f8ec8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: --name typesense \ -v /tmp/typesense-data:/data \ -v /tmp/typesense-analytics-data:/analytics-data \ - typesense/typesense:30.0.alpha1 \ + typesense/typesense:30.2 \ --api-key=xyz \ --data-dir=/data \ --enable-search-analytics=true \ @@ -29,6 +29,7 @@ jobs: with: php-version: "8.4" coverage: xdebug - - uses: php-actions/composer@v6 + - name: Install dependencies + run: composer install --no-interaction --no-progress - name: Run tests run: vendor/bin/phpunit --coverage-text --testdox diff --git a/docker-compose.yml b/docker-compose.yml index 97531a76..38eba89c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,11 @@ version: '3.5' services: typesense: - image: typesense/typesense:27.0.rc21 + image: typesense/typesense:30.2 environment: TYPESENSE_DATA_DIR: /data TYPESENSE_API_KEY: xyz + TYPESENSE_ANALYTICS_MINUTE_RATE_LIMIT: 50 volumes: - /tmp/typesense-server-data:/data ports: diff --git a/tests/Feature/CurationSetsTest.php b/tests/Feature/CurationSetsTest.php index 4219663d..6312037f 100644 --- a/tests/Feature/CurationSetsTest.php +++ b/tests/Feature/CurationSetsTest.php @@ -55,7 +55,9 @@ protected function tearDown(): void public function testCanUpsertACurationSet(): void { $this->assertEquals($this->curationSetData['items'][0]['id'], $this->upsertResponse['items'][0]['id']); - $this->assertEquals($this->curationSetData['items'][0]['rule'], $this->upsertResponse['items'][0]['rule']); + // Typesense v30.2+ adds defaults such as stem and synonyms to the rule; compare only the keys we sent. + $rule = $this->curationSetData['items'][0]['rule']; + $this->assertEquals($rule, array_intersect_key($this->upsertResponse['items'][0]['rule'], $rule)); $this->assertEquals($this->curationSetData['items'][0]['includes'], $this->upsertResponse['items'][0]['includes']); } @@ -79,7 +81,9 @@ public function testCanRetrieveASpecificCurationSet(): void { $returnData = $this->curationSets['test-curation-set']->retrieve(); $this->assertEquals($this->curationSetData['items'][0]['id'], $returnData['items'][0]['id']); - $this->assertEquals($this->curationSetData['items'][0]['rule'], $returnData['items'][0]['rule']); + // Typesense v30.2+ adds defaults such as stem and synonyms to the rule; compare only the keys we sent. + $rule = $this->curationSetData['items'][0]['rule']; + $this->assertEquals($rule, array_intersect_key($returnData['items'][0]['rule'], $rule)); $this->assertEquals($this->curationSetData['items'][0]['includes'], $returnData['items'][0]['includes']); }