-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Solr integration test capability
- Loading branch information
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Solr integration tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
integration-tests: | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
matrix: | ||
php: [7.4] # 8.0, 8.1, 8.2, 8.3 | ||
solr: [9] | ||
mode: [server] # cloud, server | ||
|
||
name: PHP ${{ matrix.php }}, Solr ${{ matrix.solr }} ${{ matrix.mode }} | ||
|
||
env: | ||
COMPOSER_MEMORY_LIMIT: -1 | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: apcu, opcache | ||
coverage: none | ||
|
||
- name: Checkout AtoM | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout solr 9.6 | ||
if: matrix.solr == 9 | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: apache/solr | ||
ref: branch_9_6 | ||
path: lucene-solr | ||
|
||
- name: Start Solr ${{ matrix.solr }} in ${{ matrix.mode }} mode | ||
run: | | ||
cd test/phpunit/arSolrPlugin/integration/fixtures/docker/solr${{ matrix.solr }}_${{ matrix.mode }} | ||
docker compose up -d | ||
- name: Install composer dependencies | ||
run: | | ||
composer update | ||
- name: Run tests | ||
run: | | ||
vendor/composer/bin/phpunit --group solr_integration -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @group solr_integration | ||
* | ||
* @covers \arSolrExistsQuery | ||
*/ | ||
class QueryTest extends TestCase | ||
{ | ||
public function setUp(): void {} | ||
|
||
public function testQuery() { | ||
$this->assertTrue(true, "true is not true!"); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
test/phpunit/arSolrPlugin/integration/fixtures/docker/solr9_server/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3' | ||
services: | ||
solr9: | ||
image: solr:9 | ||
ports: | ||
- 8983:8983 | ||
networks: | ||
solr: | ||
aliases: | ||
- solr | ||
volumes: | ||
- ../../../../../lucene-solr/solr/server/solr/configsets/sample_techproducts_configs/conf:/opt/solr/server/solr/configsets/solarium/conf | ||
command: bash -c "chown -R solr.solr /opt/solr/server/solr/configsets/solarium; cp -R /opt/solr/server/solr/configsets /var/solr/data/configsets; docker-entrypoint.sh solr start -f" | ||
|
||
proxy: | ||
image: ubuntu/squid | ||
ports: | ||
- 8080:3128 | ||
networks: | ||
- solr | ||
|
||
networks: | ||
solr: |