Skip to content

Commit d3cf17f

Browse files
committed
AC-7116: Skipped Unit tests for ES7 if ES8 is configured
1 parent 60fb0e2 commit d3cf17f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

app/code/Magento/Elasticsearch/Test/Unit/Elasticsearch5/Model/Client/ElasticsearchTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,10 @@ public function testDeleteMapping()
489489
*/
490490
public function testBuildConfig(array $options, $expectedResult): void
491491
{
492+
if (!class_exists(\Elasticsearch\ClientBuilder::class)) {
493+
$this->markTestSkipped('AC-6597: Skipped as Elasticsearch 8 is configured');
494+
}
495+
492496
$buildConfig = new Elasticsearch($options);
493497
$config = $this->getPrivateMethod(Elasticsearch::class, 'buildConfig');
494498
$result = $config->invoke($buildConfig, $options);

app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/ElasticsearchTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class ElasticsearchTest extends TestCase
111111
*/
112112
protected function setUp(): void
113113
{
114+
if (!class_exists(\Elasticsearch\Client::class)) {
115+
$this->markTestSkipped('AC-6597: Skipped as Elasticsearch 8 is configured');
116+
}
117+
114118
$this->objectManager = new ObjectManagerHelper($this);
115119
$this->connectionManager = $this->getMockBuilder(ConnectionManager::class)
116120
->disableOriginalConstructor()

app/code/Magento/Elasticsearch7/Test/Unit/Model/DataProvider/Base/SuggestionsTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ public function testGetItemsWithEnabledSearchSuggestion(): void
226226
*/
227227
public function testGetItemsException(): void
228228
{
229+
if (!class_exists(\Elasticsearch\Client::class)) {
230+
$this->markTestSkipped('AC-6597: Skipped as Elasticsearch 8 is configured');
231+
}
232+
229233
$this->prepareSearchQuery();
230234
$exception = new BadRequest400Exception();
231235

0 commit comments

Comments
 (0)