Skip to content

Commit

Permalink
Merge pull request #2501 from magento-borg/DEVOPS-2174
Browse files Browse the repository at this point in the history
Fixed issues:
- DEVOPS-232 Static Testing in Jenkins
  • Loading branch information
slavvka authored May 9, 2018
2 parents fb5eccf + 8b02375 commit b16dfc6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
namespace Magento\TestFramework\Annotation;

use PHPUnit\Framework\Exception;

class DataFixture
{
/**
Expand Down Expand Up @@ -171,8 +173,13 @@ protected function _applyOneFixture($fixture)
require $fixture;
}
} catch (\Exception $e) {
throw new \Exception(
sprintf("Error in fixture: %s.\n %s", json_encode($fixture), $e->getMessage()),
throw new Exception(
sprintf(
"Error in fixture: %s.\n %s\n %s",
json_encode($fixture),
$e->getMessage(),
$e->getTraceAsString()
),
500,
$e
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
namespace Magento\TestFramework\Annotation;

use PHPUnit\Framework\Exception;

class DataFixtureBeforeTransaction
{
/**
Expand Down Expand Up @@ -138,8 +140,15 @@ protected function _applyOneFixture($fixture)
require $fixture;
}
} catch (\Exception $e) {
throw new \Exception(
sprintf("Error in fixture: %s.\n %s", json_encode($fixture), (string)$e)
throw new Exception(
sprintf(
"Error in fixture: %s.\n %s\n %s",
json_encode($fixture),
$e->getMessage(),
$e->getTraceAsString()
),
500,
$e
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testLoadDataCaching()
/** @var \Magento\Framework\Translate $model */
$model = $this->objectManager->get(\Magento\Framework\Translate::class);

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

/** @var \Magento\Translation\Model\ResourceModel\StringUtils $translateString */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Tests the different cases of consumers running by ConsumersRunner
*
* {@inheritdoc}
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ConsumersRunnerTest extends \PHPUnit\Framework\TestCase
{
Expand Down Expand Up @@ -104,7 +105,7 @@ protected function setUp()
$command = str_replace('bin/magento', 'dev/tests/integration/bin/magento', $command);
$command = $params . ' ' . $command;

return exec("{$command} > /dev/null &");
return exec("{$command} >/dev/null &");
});
}

Expand Down

0 comments on commit b16dfc6

Please sign in to comment.