Skip to content

Commit

Permalink
IBX-5133: Allowed Solr tests to be executed against different hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p authored Feb 22, 2023
1 parent 5c6878b commit 2fbf2a3
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 28 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ on:
jobs:
cs-fix:
name: Run code style check
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
strategy:
matrix:
php:
- '8.0'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand All @@ -26,16 +26,16 @@ jobs:
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"
dependency-versions: highest

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
name: Unit tests
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
timeout-minutes: 15

strategy:
Expand All @@ -48,7 +48,7 @@ jobs:
- '8.1'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand All @@ -58,9 +58,9 @@ jobs:
extensions: pdo_sqlite, gd
tools: cs2pr

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"
dependency-versions: highest

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
solr-integration:
name: "Integration tests"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
strategy:
fail-fast: false
matrix:
Expand All @@ -34,17 +34,17 @@ jobs:
name: "Set up single core"
run: echo "SOLR_CORES=collection1" >> $GITHUB_ENV

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"
dependency-versions: highest

- name: Init Solr
run: ./.github/init_solr.sh
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"branch-alias": {
"dev-master": "3.3.x-dev"
}
},
"config": {
"allow-plugins": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ public function testBoostFactorMap(array $configuration, array $map)
/**
* @dataProvider getDataForTestHttpClientConfiguration
*
* @phpstan-param SolrHttpClientConfigArray $httpClientConfig
* @phpstan-param SolrHttpClientConfigArray $config
*/
public function testHttpClientConfiguration(array $config): void
{
Expand All @@ -679,6 +679,9 @@ public function testHttpClientConfiguration(array $config): void
);
}

/**
* @return iterable<string, array<SolrHttpClientConfigArray>>
*/
public function getDataForTestHttpClientConfiguration(): iterable
{
yield 'default values' => [
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/Resources/config/cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core0
Expand All @@ -45,7 +45,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core1
Expand All @@ -57,7 +57,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core2
Expand All @@ -69,7 +69,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core3
Expand Down
12 changes: 6 additions & 6 deletions tests/lib/Resources/config/multicore_dedicated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core0
Expand All @@ -44,7 +44,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core1
Expand All @@ -56,7 +56,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core2
Expand All @@ -68,7 +68,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core3
Expand All @@ -80,7 +80,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core4
Expand All @@ -92,7 +92,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core5
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/Resources/config/multicore_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core0
Expand All @@ -39,7 +39,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core1
Expand All @@ -51,7 +51,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core2
Expand All @@ -63,7 +63,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: core3
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Resources/config/single_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
arguments:
-
scheme: http
host: localhost
host: '%test.ibexa.solr.host%'
port: 8983
path: /solr
core: collection1
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/SetupFactory/LegacySetupFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public function getRepository($initializeFromScratch = true)
*/
protected function externalBuildContainer(ContainerBuilder $containerBuilder): void
{
$containerBuilder->setParameter('test.ibexa.solr.host', getenv('SOLR_HOST') ?: 'localhost');

$settingsPath = __DIR__ . '/../../../lib/Resources/config/container/';
$testSettingsPath = __DIR__ . '/../Resources/config/';

Expand Down

0 comments on commit 2fbf2a3

Please sign in to comment.