Skip to content

Commit 9272091

Browse files
committed
MAGETWO-85581: Enable metrics validation and run benchmark in multithread mode for PAT
1 parent 8116880 commit 9272091

File tree

12 files changed

+48
-42
lines changed

12 files changed

+48
-42
lines changed

app/code/Magento/Catalog/Model/Product/Image.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,6 @@ protected function _fileExists($filename)
883883
*/
884884
public function getResizedImageInfo()
885885
{
886-
$errorMessage = 'Can\'t get information about the picture: ';
887886
try {
888887
if ($this->isBaseFilePlaceholder() == true) {
889888
$image = $this->imageAsset->getSourceFile();
@@ -896,7 +895,7 @@ public function getResizedImageInfo()
896895
return $imageProperties;
897896
} finally {
898897
if (empty($imageProperties)) {
899-
throw new NotLoadInfoImageException(__($errorMessage . $image));
898+
throw new NotLoadInfoImageException(__('Can\'t get information about the picture: %1', $image));
900899
}
901900
}
902901
}

app/code/Magento/Catalog/Model/Product/Image/NotLoadInfoImageException.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
*/
66
namespace Magento\Catalog\Model\Product\Image;
77

8-
use Magento\Framework\Exception\LocalizedException;
9-
10-
/**
11-
* @api
12-
* @since 102.0.0
13-
*/
14-
class NotLoadInfoImageException extends LocalizedException
8+
class NotLoadInfoImageException extends \Exception
159
{
1610
}

dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixtureModelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function testFixtureGeneration()
118118

119119
foreach ($this->entityAsserts as $entityAssert) {
120120
try {
121-
$entityAssert->assert();
121+
$this->assertTrue($entityAssert->assert());
122122
} catch (\AssertionError $assertionError) {
123123
$this->assertTrue(false, $assertionError->getMessage());
124124
}

dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/BundleProductsAssert.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(
4848
/**
4949
* Asserts that generated bundled products are valid
5050
*
51-
* @return void
51+
* @return bool
5252
* @throws \Magento\Framework\Exception\NoSuchEntityException
5353
* @throws \AssertionError
5454
*/
@@ -74,5 +74,7 @@ public function assert()
7474
throw new \AssertionError('Bundle option product links amount is wrong');
7575
}
7676
}
77+
78+
return true;
7779
}
7880
}

dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/ConfigurableProductsAssert.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(
4646
/**
4747
* Asserts that generated configurable products are valid
4848
*
49-
* @return void
49+
* @return bool
5050
* @throws \Magento\Framework\Exception\NoSuchEntityException
5151
* @throws \Magento\Framework\Exception\InputException
5252
* @throws \AssertionError
@@ -86,5 +86,7 @@ public function assert()
8686
throw new \AssertionError('Configurable option values amount is wrong');
8787
}
8888
}
89+
90+
return true;
8991
}
9092
}

dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/ImagesAssert.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function __construct(
7070
/**
7171
* Performs assertions over images
7272
*
73+
* @return bool
7374
* @throws \AssertionError
7475
*/
7576
public function assert()
@@ -82,6 +83,8 @@ public function assert()
8283
$this->assertProductMediaAttributes($product);
8384
$this->assertProductImageExistsInFS($product);
8485
}
86+
87+
return true;
8588
}
8689

8790
/**

dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/SimpleProductsAssert.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
/**
4444
* Asserts that generated simple products are valid
4545
*
46-
* @return void
46+
* @return bool
4747
* @throws \Magento\Framework\Exception\NoSuchEntityException
4848
* @throws \AssertionError
4949
*/
@@ -52,5 +52,7 @@ public function assert()
5252
$product = $this->productRepository->get(sprintf(SimpleProductsFixture::SKU_PATTERN, 1));
5353
$this->productAssert->assertProductsCount(SimpleProductsFixture::SKU_PATTERN, 2);
5454
$this->productAssert->assertProductType('simple', $product);
55+
56+
return true;
5557
}
5658
}

dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/exception_hierarchy.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
\Magento\Framework\DB\Adapter\DuplicateException
1010
\Magento\Framework\DB\DataConverter\DataConversionException
1111
\Magento\Framework\DB\FieldDataConversionException
12+
\Magento\Catalog\Model\Product\Image\NotLoadInfoImageException

setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
/**
1919
* Command generates fixtures for performance tests
20+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2021
*/
2122
class GenerateFixturesCommand extends Command
2223
{
@@ -84,7 +85,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
8485
}
8586

8687
/** @var \Magento\Setup\Fixtures\ConfigsApplyFixture $configFixture */
87-
$configFixture = $fixtureModel->getConfigurationFixture();
88+
$configFixture = $fixtureModel
89+
->getFixtureByName(\Magento\Setup\Fixtures\ConfigsApplyFixture::class);
8890
$configFixture && $this->executeFixture($configFixture, $output);
8991

9092
/** @var $config \Magento\Indexer\Model\Config */
@@ -106,7 +108,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
106108
$this->clearChangelog();
107109

108110
/** @var \Magento\Setup\Fixtures\IndexersStatesApplyFixture $indexerFixture */
109-
$indexerFixture = $this->fixtureModel->getIndexerFixture();
111+
$indexerFixture = $fixtureModel
112+
->getFixtureByName(\Magento\Setup\Fixtures\IndexersStatesApplyFixture::class);
110113
$indexerFixture && $this->executeFixture($indexerFixture, $output);
111114

112115
if (!$input->getOption(self::SKIP_REINDEX_OPTION)) {

setup/src/Magento/Setup/Fixtures/ConfigsApplyFixture.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ConfigsApplyFixture extends Fixture
1414
/**
1515
* @var int
1616
*/
17-
protected $priority = 0;
17+
protected $priority = -1;
1818

1919
/**
2020
* {@inheritdoc}

0 commit comments

Comments
 (0)