Skip to content

Commit

Permalink
MAGECLOUD-2925: Raise additional log message levels (#393)
Browse files Browse the repository at this point in the history
MAGECLOUD-2925 Raise additional log message levels
  • Loading branch information
billygilbert committed Dec 11, 2018
1 parent a30a51f commit e517b5c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/Process/Build/CompileDi.php
Expand Up @@ -55,12 +55,13 @@ public function execute()
{
$verbosityLevel = $this->stageConfig->get(BuildInterface::VAR_VERBOSE_COMMANDS);

$this->logger->info('Running DI compilation');
$this->logger->notice('Running DI compilation');

try {
$this->shell->execute("php ./bin/magento setup:di:compile {$verbosityLevel} --ansi --no-interaction");
} catch (ShellException $exception) {
throw new ProcessException($exception->getMessage(), $exception->getCode(), $exception);
}
$this->logger->notice('End of running DI compilation');
}
}
3 changes: 2 additions & 1 deletion src/Process/Build/RefreshModules.php
Expand Up @@ -43,12 +43,13 @@ public function __construct(
*/
public function execute()
{
$this->logger->info('Reconciling installed modules with shared config.');
$this->logger->notice('Reconciling installed modules with shared config.');

try {
$this->config->refresh();
} catch (ShellException $exception) {
throw new ProcessException($exception->getMessage(), $exception->getCode(), $exception);
}
$this->logger->notice('End of reconciling modules.');
}
}
4 changes: 2 additions & 2 deletions src/Process/ValidateConfiguration.php
Expand Up @@ -44,7 +44,7 @@ public function __construct(
*/
public function execute()
{
$this->logger->info('Validating configuration');
$this->logger->notice('Validating configuration');

$maxLevel = 0;
$messages = [];
Expand All @@ -70,7 +70,7 @@ function ($line) {
}
}

$this->logger->info('End of validation');
$this->logger->notice('End of validation');

if (!$messages || !$maxLevel) {
return;
Expand Down
9 changes: 6 additions & 3 deletions src/Test/Unit/Process/Build/CompileDiTest.php
Expand Up @@ -61,9 +61,12 @@ public function testExecute()
->method('get')
->with(BuildInterface::VAR_VERBOSE_COMMANDS)
->willReturn('-vvv');
$this->loggerMock->expects($this->once())
->method('info')
->with('Running DI compilation');
$this->loggerMock->expects($this->exactly(2))
->method('notice')
->withConsecutive(
['Running DI compilation'],
['End of running DI compilation']
);
$this->shellMock->expects($this->once())
->method('execute')
->with('php ./bin/magento setup:di:compile -vvv --ansi --no-interaction');
Expand Down
9 changes: 6 additions & 3 deletions src/Test/Unit/Process/Build/RefreshModulesTest.php
Expand Up @@ -48,9 +48,12 @@ protected function setUp()

public function testExecute()
{
$this->loggerMock->expects($this->once())
->method('info')
->with('Reconciling installed modules with shared config.');
$this->loggerMock->expects($this->exactly(2))
->method('notice')
->withConsecutive(
['Reconciling installed modules with shared config.'],
['End of reconciling modules.']
);
$this->configMock->expects($this->once())
->method('refresh');

Expand Down
8 changes: 4 additions & 4 deletions src/Test/Unit/Process/ValidateConfigurationTest.php
Expand Up @@ -36,7 +36,7 @@ public function testExecuteWithoutValidators()
);

$this->loggerMock->expects($this->exactly(2))
->method('info')
->method('notice')
->withConsecutive(
['Validating configuration'],
['End of validation']
Expand Down Expand Up @@ -70,7 +70,7 @@ public function testExecuteWithCriticalError()
->method('validate');

$this->loggerMock->expects($this->exactly(2))
->method('info')
->method('notice')
->withConsecutive(
['Validating configuration'],
['End of validation']
Expand Down Expand Up @@ -108,7 +108,7 @@ public function testExecuteWithWarningMessage()
->willReturn($warningResultMock);

$this->loggerMock->expects($this->exactly(2))
->method('info')
->method('notice')
->withConsecutive(
['Validating configuration'],
['End of validation']
Expand Down Expand Up @@ -163,7 +163,7 @@ public function testExecuteWithWarningAndCriticalMessage()
->willReturn($this->createMock(Result\Success::class));

$this->loggerMock->expects($this->exactly(2))
->method('info')
->method('notice')
->withConsecutive(
['Validating configuration'],
['End of validation']
Expand Down

0 comments on commit e517b5c

Please sign in to comment.