Skip to content

Commit 69e4f4f

Browse files
Merge pull request #190 from magento-commerce/develop
MCLOUD-13628: Cloud release ece-tools 2002.2.4
2 parents 9771520 + ea3ac70 commit 69e4f4f

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/ece-tools",
33
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "2002.2.3",
5+
"version": "2002.2.4",
66
"license": "OSL-3.0",
77
"repositories": {
88
"repo.magento.com": {

src/Service/OpenSearch.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
*/
5252
public function getFullEngineName(): string
5353
{
54-
if ($this->magentoVersion->isGreaterOrEqual('2.4.4')) {
54+
if ($this->magentoVersion->satisfies('2.4.4-p13 || >=2.4.5-p12')) {
5555
return static::ENGINE_NAME;
5656
}
5757

src/Service/Search/AbstractService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function getVersion(): string
117117
}
118118
}
119119

120-
return preg_replace('/-.*/', '', $this->version); // Removes any suffix after '-'
120+
return $this->version;
121121
}
122122

123123
/**

src/Service/Validator.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ class Validator
9494
'>=2.4.4' => '~7.10.0', // Greater than 7.10 isn't supported on cloud infrastructure.
9595
],
9696
ServiceInterface::NAME_OPENSEARCH => [
97-
'>=2.3.7-p3 <2.4.0 || >=2.4.3-p2 <2.4.4-p13 || 2.4.5 || >=2.4.5-p1 <2.4.5-p12' => '~1.1.0 || 1.2.*',
97+
'>=2.3.7-p3 <2.4.0 || >=2.4.3-p2 <2.4.4-p7 || >=2.4.5 <2.4.5-p7' => '~1.1.0 || 1.2.*',
98+
'>=2.4.4-p8 <2.4.4-p12 || >=2.4.5-p6 <2.4.5-p11' => '1.3.*',
9899
'2.4.4-p13 || >=2.4.5-p12' => '^2'
99100
],
100101
ServiceInterface::NAME_RABBITMQ => [

src/Step/Deploy/InstallUpdate/Install/Setup/InstallCommandFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ private function getEsOptions(): array
268268
$configuration = $this->openSearch->getConfiguration();
269269
$isAuthEnabled = $this->openSearch->isAuthEnabled();
270270

271-
if ($this->magentoVersion->isGreaterOrEqual('2.4.4')) {
271+
if ($this->magentoVersion->satisfies('2.4.4-p13 || >=2.4.5-p12')) {
272272
$enginePrefixName = 'opensearch';
273273
}
274274
} else {

src/Test/Unit/Service/OpenSearchTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getVersionFromTypeDataProvider()
222222
*/
223223
public function testGetFullEngineName(bool $greaterOrEqual, string $expectedResult): void
224224
{
225-
$this->magentoVersionMock->expects($this->once())
225+
$this->magentoVersionMock->expects($this->any())
226226
->method('isGreaterOrEqual')
227227
->willReturn($greaterOrEqual);
228228
$this->assertSame($expectedResult, $this->openSearch->getFullEngineName());
@@ -234,8 +234,8 @@ public function testGetFullEngineName(bool $greaterOrEqual, string $expectedResu
234234
public function getFullEngineNameDataProvider()
235235
{
236236
return [
237+
[true, 'elasticsearch7'],
237238
[false, 'elasticsearch7'],
238-
[true, 'opensearch'],
239239
];
240240
}
241241

src/Test/Unit/Step/Deploy/InstallUpdate/Install/Setup/InstallCommandFactoryTest.php

+10-11
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,12 @@ public function testExecuteWithOSauthOptions(
503503
['2.4.2', true],
504504
['2.4.4', $greaterOrEqual],
505505
]);
506-
$this->magentoVersionMock->expects($this->once())
507-
->method('satisfies')
508-
->with('>=2.3.7-p3 <2.4.0 || >=2.4.3-p2')
509-
->willReturn(true);
506+
507+
$this->magentoVersionMock->method('satisfies')
508+
->willReturnCallback(function (string $constraint) {
509+
$supportedConstraint = '>=2.3.7-p3 <2.4.0 || >=2.4.3-p2';
510+
return $constraint === $supportedConstraint;
511+
});
510512
$this->openSearchMock->expects($this->any())
511513
->method('isInstalled')
512514
->willReturn(true);
@@ -515,7 +517,7 @@ public function testExecuteWithOSauthOptions(
515517
->willReturn(true);
516518
$this->openSearchMock->expects($this->once())
517519
->method('getFullEngineName')
518-
->willReturn('opensearch');
520+
->willReturn('opensearch1');
519521
$this->openSearchMock->expects($this->once())
520522
->method('getHost')
521523
->willReturn('127.0.0.1');
@@ -536,7 +538,7 @@ public function testExecuteWithOSauthOptions(
536538

537539
$this->elasticSearchMock->expects($this->any())
538540
->method('isInstalled')
539-
->willReturn(false);
541+
->willReturn(true);
540542
$this->elasticSearchMock->expects($this->never())
541543
->method('isAuthEnabled');
542544
$this->elasticSearchMock->expects($this->never())
@@ -549,7 +551,7 @@ public function testExecuteWithOSauthOptions(
549551
->method('getConfiguration');
550552

551553
$command = $this->installCommandFactory->create();
552-
self::assertStringContainsString("--search-engine='opensearch'", $command);
554+
self::assertStringContainsString("--search-engine='opensearch1'", $command);
553555
self::assertStringContainsString("--" . $enginePrefixName . "-enable-auth='1'", $command);
554556
self::assertStringContainsString("--" . $enginePrefixName . "-username='user'", $command);
555557
self::assertStringContainsString("--" . $enginePrefixName . "-password='secret'", $command);
@@ -561,10 +563,7 @@ public function testExecuteWithOSauthOptions(
561563
*/
562564
public function executeWithOSauthOptionsDataProvider()
563565
{
564-
return [
565-
[false, 'elasticsearch'],
566-
[true, 'opensearch'],
567-
];
566+
return [[false, 'elasticsearch']];
568567
}
569568

570569
/**

0 commit comments

Comments
 (0)