Skip to content

Commit c9f2797

Browse files
committed
Handling CLI error as a failure when validating composer.json file
1 parent d844e31 commit c9f2797

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ private function validateComposerJsonFile($path)
9999
/** @var \Magento\Framework\Composer\MagentoComposerApplicationFactory $appFactory */
100100
$appFactory = self::$objectManager->get(\Magento\Framework\Composer\MagentoComposerApplicationFactory::class);
101101
$app = $appFactory->create();
102-
$app->runComposerCommand(['command' => 'validate'], $path);
102+
103+
try {
104+
$app->runComposerCommand(['command' => 'validate'], $path);
105+
} catch (\RuntimeException $exception) {
106+
$this->fail("Failed validation of {$path}");
107+
}
103108
}
104109

105110
/**

0 commit comments

Comments
 (0)