Skip to content

Commit e1241f8

Browse files
committed
B2B-2081: Stabilize general tests along with S3 specific PR validation tests
1 parent 7b8a20a commit e1241f8

9 files changed

+38
-2
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/FileAssertions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ public function __construct(ModuleContainer $moduleContainer, ?array $config = n
5757
{
5858
parent::__construct($moduleContainer, $config);
5959
$this->storageType = getenv('MEDIA_STORAGE_DRIVER') ?: self::STORAGE_TYPE_LOCAL;
60-
if (!empty($this->storageType) && $this->storageType === 's3') {
60+
if ($this->storageType === self::STORAGE_TYPE_S3) {
6161
$this->helperInstance = new S3FileAssertions($moduleContainer, $config);
6262
} else {
6363
$this->helperInstance = new LocalFileAssertions($moduleContainer, $config);
6464
}
6565
}
6666

6767
/**
68-
* Create text file.
68+
* Create a file in the storage.
6969
*
7070
* @param string $filePath - path to file or json structure with paths by storage type.
7171
* @param string $text

app/code/Magento/AwsS3/Test/Mftf/Helper/FileAssertionsInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function assertFileExists($filePath, $message = ''): void;
8282
* @param string $path
8383
* @param string $pattern
8484
* @param string $message
85+
* @return void
8586
*
8687
* @throws \Magento\Framework\Exception\FileSystemException
8788
*/

app/code/Magento/AwsS3/Test/Mftf/Test/AdminExportBundleProductTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminExportBundleProductTest">
12+
13+
<!-- S3 stores import/export artifacts in a different path than the local file system.
14+
This test is used to merge with the local file system test and allows the resulting merged test
15+
to use the correct path when Magento is either installed with S3 enabled or with S3 disabled -->
16+
1217
<after>
1318
<helper class="\Magento\AwsS3\Test\Mftf\Helper\FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
1419
<argument name="path">{"local":"var/export","s3":"import_export/export"}</argument>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminExportDownloadableProductWithFileLinksTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminExportDownloadableProductWithFileLinksTest">
12+
13+
<!-- S3 stores import/export artifacts in a different path than the local file system.
14+
This test is used to merge with the local file system test and allows the resulting merged test
15+
to use the correct path when Magento is either installed with S3 enabled or with S3 disabled -->
16+
1217
<after>
1318
<helper class="\Magento\AwsS3\Test\Mftf\Helper\FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
1419
<argument name="path">{"local":"var/export","s3":"import_export/export"}</argument>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminExportDownloadableProductWithURLLinksTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminExportDownloadableProductWithURLLinksTest">
12+
13+
<!-- S3 stores import/export artifacts in a different path than the local file system.
14+
This test is used to merge with the local file system test and allows the resulting merged test
15+
to use the correct path when Magento is either installed with S3 enabled or with S3 disabled -->
16+
1217
<after>
1318
<helper class="\Magento\AwsS3\Test\Mftf\Helper\FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
1419
<argument name="path">{"local":"var/export","s3":"import_export/export"}</argument>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminExportFilenameTimezoneTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminExportFilenameTimezoneTest">
12+
13+
<!-- S3 stores import/export artifacts in a different path than the local file system.
14+
This test is used to merge with the local file system test and allows the resulting merged test
15+
to use the correct path when Magento is either installed with S3 enabled or with S3 disabled -->
16+
1217
<!-- Verify that the file exists on remote storage -->
1318
<helper class="Magento\AwsS3\Test\Mftf\Helper\FileAssertions"
1419
method="assertFileExists"

app/code/Magento/AwsS3/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminExportGroupedProductWithSpecialPriceTest">
12+
13+
<!-- S3 stores import/export artifacts in a different path than the local file system.
14+
This test is used to merge with the local file system test and allows the resulting merged test
15+
to use the correct path when Magento is either installed with S3 enabled or with S3 disabled -->
16+
1217
<after>
1318
<helper class="\Magento\AwsS3\Test\Mftf\Helper\FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
1419
<argument name="path">{"local":"var/export","s3":"import_export/export"}</argument>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest">
12+
13+
<!-- S3 stores import/export artifacts in a different path than the local file system.
14+
This test is used to merge with the local file system test and allows the resulting merged test
15+
to use the correct path when Magento is either installed with S3 enabled or with S3 disabled -->
16+
1217
<after>
1318
<helper class="\Magento\AwsS3\Test\Mftf\Helper\FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
1419
<argument name="path">{"local":"var/export","s3":"import_export/export"}</argument>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest">
12+
13+
<!-- S3 stores import/export artifacts in a different path than the local file system.
14+
This test is used to merge with the local file system test and allows the resulting merged test
15+
to use the correct path when Magento is either installed with S3 enabled or with S3 disabled -->
16+
1217
<after>
1318
<helper class="\Magento\AwsS3\Test\Mftf\Helper\FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
1419
<argument name="path">{"local":"var/export","s3":"import_export/export"}</argument>

0 commit comments

Comments
 (0)