Skip to content

Commit b16dfc6

Browse files
authored
Merge pull request #2501 from magento-borg/DEVOPS-2174
Fixed issues: - DEVOPS-232 Static Testing in Jenkins
2 parents fb5eccf + 8b02375 commit b16dfc6

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

dev/tests/integration/framework/Magento/TestFramework/Annotation/DataFixture.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
namespace Magento\TestFramework\Annotation;
1111

12+
use PHPUnit\Framework\Exception;
13+
1214
class DataFixture
1315
{
1416
/**
@@ -171,8 +173,13 @@ protected function _applyOneFixture($fixture)
171173
require $fixture;
172174
}
173175
} catch (\Exception $e) {
174-
throw new \Exception(
175-
sprintf("Error in fixture: %s.\n %s", json_encode($fixture), $e->getMessage()),
176+
throw new Exception(
177+
sprintf(
178+
"Error in fixture: %s.\n %s\n %s",
179+
json_encode($fixture),
180+
$e->getMessage(),
181+
$e->getTraceAsString()
182+
),
176183
500,
177184
$e
178185
);

dev/tests/integration/framework/Magento/TestFramework/Annotation/DataFixtureBeforeTransaction.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
namespace Magento\TestFramework\Annotation;
1111

12+
use PHPUnit\Framework\Exception;
13+
1214
class DataFixtureBeforeTransaction
1315
{
1416
/**
@@ -138,8 +140,15 @@ protected function _applyOneFixture($fixture)
138140
require $fixture;
139141
}
140142
} catch (\Exception $e) {
141-
throw new \Exception(
142-
sprintf("Error in fixture: %s.\n %s", json_encode($fixture), (string)$e)
143+
throw new Exception(
144+
sprintf(
145+
"Error in fixture: %s.\n %s\n %s",
146+
json_encode($fixture),
147+
$e->getMessage(),
148+
$e->getTraceAsString()
149+
),
150+
500,
151+
$e
143152
);
144153
}
145154
}

dev/tests/integration/testsuite/Magento/Framework/TranslateCachingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testLoadDataCaching()
4848
/** @var \Magento\Framework\Translate $model */
4949
$model = $this->objectManager->get(\Magento\Framework\Translate::class);
5050

51-
$model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND); // this is supposed to cache the fixture
51+
$model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND, true); // this is supposed to cache the fixture
5252
$this->assertEquals('Fixture Db Translation', new Phrase('Fixture String'));
5353

5454
/** @var \Magento\Translation\Model\ResourceModel\StringUtils $translateString */

dev/tests/integration/testsuite/Magento/MessageQueue/Model/Cron/ConsumersRunnerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Tests the different cases of consumers running by ConsumersRunner
2020
*
2121
* {@inheritdoc}
22+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2223
*/
2324
class ConsumersRunnerTest extends \PHPUnit\Framework\TestCase
2425
{
@@ -104,7 +105,7 @@ protected function setUp()
104105
$command = str_replace('bin/magento', 'dev/tests/integration/bin/magento', $command);
105106
$command = $params . ' ' . $command;
106107

107-
return exec("{$command} > /dev/null &");
108+
return exec("{$command} >/dev/null &");
108109
});
109110
}
110111

0 commit comments

Comments
 (0)