Skip to content

Commit

Permalink
Add Solr integration test capability
Browse files Browse the repository at this point in the history
  • Loading branch information
sbreker committed Aug 15, 2024
1 parent 5b00b7a commit c74ff1e
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/integration-tests-solr.yml
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
19 changes: 19 additions & 0 deletions test/phpunit/arSolrPlugin/integration/QueryTest.php
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!");
}
}
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:

0 comments on commit c74ff1e

Please sign in to comment.