File tree Expand file tree Collapse file tree 5 files changed +55
-7
lines changed Expand file tree Collapse file tree 5 files changed +55
-7
lines changed Original file line number Diff line number Diff line change 6
6
<arguments >
7
7
<argument name =" logger" xsi : type =" object" >Psr\Log\LoggerInterface</argument >
8
8
<argument name =" validators" xsi : type =" array" >
9
- <item name =" 500 " xsi : type =" array" >
9
+ <item name =" critical " xsi : type =" array" >
10
10
<item name =" composer" xsi : type =" object" priority =" 100" >Magento\MagentoCloud\Config\Validator\Build\ComposerFile</item >
11
11
<item name =" stage-config" xsi : type =" object" priority =" 200" >Magento\MagentoCloud\Config\Validator\Build\StageConfig</item >
12
12
</item >
13
- <item name =" 300 " xsi : type =" array" >
13
+ <item name =" warning " xsi : type =" array" >
14
14
<item name =" config-file-exists" xsi : type =" object" priority =" 100" >Magento\MagentoCloud\Config\Validator\Build\ConfigFileExists</item >
15
15
<item name =" deprecated-ini" xsi : type =" object" priority =" 200" >Magento\MagentoCloud\Config\Validator\Build\UnsupportedBuildOptionsIni</item >
16
16
<item name =" modules-exists" xsi : type =" object" priority =" 300" >Magento\MagentoCloud\Config\Validator\Build\ModulesExists</item >
17
17
<item name =" appropriate-version" xsi : type =" object" priority =" 400" >Magento\MagentoCloud\Config\Validator\Build\AppropriateVersion</item >
18
18
<item name =" scd-options-ignorance" xsi : type =" object" priority =" 500" >Magento\MagentoCloud\Config\Validator\Build\ScdOptionsIgnorance</item >
19
19
<item name =" ideal-state" xsi : type =" object" priority =" 600" >Magento\MagentoCloud\Config\Validator\IdealState</item >
20
20
</item >
21
+ <item name =" notice" xsi : type =" array" >
22
+ <item name =" ideal-state" xsi : type =" object" priority =" 600" >Magento\MagentoCloud\Config\Validator\IdealState</item >
23
+ </item >
21
24
</argument >
22
25
</arguments >
23
26
</step >
Original file line number Diff line number Diff line change 21
21
<arguments >
22
22
<argument name =" logger" xsi : type =" object" >Psr\Log\LoggerInterface</argument >
23
23
<argument name =" validators" xsi : type =" array" >
24
- <item name =" 500 " xsi : type =" array" >
24
+ <item name =" critical " xsi : type =" array" >
25
25
<item name =" database-configuration" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\DatabaseConfiguration</item >
26
26
<item name =" search-configuration" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\SearchConfiguration</item >
27
27
<item name =" resource-configuration" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\ResourceConfiguration</item >
28
28
<item name =" session-configuration" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\SessionConfiguration</item >
29
29
<item name =" elasticsuite-integrity" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\ElasticSuiteIntegrity</item >
30
30
</item >
31
- <item name =" 300 " xsi : type =" array" >
31
+ <item name =" warning " xsi : type =" array" >
32
32
<item name =" report-dir-nesting-level" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\ReportDirNestingLevel</item >
33
33
<item name =" admin-data" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\AdminData</item >
34
34
<item name =" php-version" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\PhpVersion</item >
43
43
<item name =" service-version" xsi : type =" object" >Magento\MagentoCloud\Config\Validator\Deploy\ServiceVersion</item >
44
44
<item name =" service-eol-warning" xsi : type =" object" >ServiceEol.Warnings</item >
45
45
</item >
46
- <item name =" 250 " xsi : type =" array" >
46
+ <item name =" notice " xsi : type =" array" >
47
47
<item name =" service-eol-notice" xsi : type =" object" >ServiceEol.Notices</item >
48
48
</item >
49
49
</argument >
Original file line number Diff line number Diff line change 5
5
<arguments >
6
6
<argument name =" logger" xsi : type =" object" >Psr\Log\LoggerInterface</argument >
7
7
<argument name =" validators" xsi : type =" array" >
8
- <item name =" 300 " xsi : type =" array" >
8
+ <item name =" warning " xsi : type =" array" >
9
9
<item name =" debug-logging" xsi : type =" object" priority =" 100" >Magento\MagentoCloud\Config\Validator\Deploy\DebugLogging</item >
10
10
</item >
11
11
</argument >
Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \MagentoCloud \Step ;
9
9
10
+ use Magento \MagentoCloud \App \Logger ;
10
11
use Magento \MagentoCloud \Config \Validator \Result \Error ;
11
12
use Magento \MagentoCloud \Config \ValidatorInterface ;
12
13
use Psr \Log \LoggerInterface ;
@@ -64,7 +65,8 @@ public function execute()
64
65
}
65
66
66
67
/**
67
- * Returns all validation messages grouped by validation level
68
+ * Returns all validation messages grouped by validation level.
69
+ * Converts validation level to integer value using @see Logger::toMonologLevel() method
68
70
*
69
71
* @return array
70
72
*/
@@ -74,6 +76,7 @@ private function collectMessages(): array
74
76
75
77
/* @var $validators ValidatorInterface[] */
76
78
foreach ($ this ->validators as $ level => $ validators ) {
79
+ $ level = Logger::toMonologLevel ($ level );
77
80
foreach ($ validators as $ name => $ validator ) {
78
81
if (!$ validator instanceof ValidatorInterface) {
79
82
$ this ->logger ->info (sprintf ('Validator "%s" was skipped ' , $ name ));
Original file line number Diff line number Diff line change @@ -146,6 +146,48 @@ public function testExecuteWithWarningAndCriticalMessage()
146
146
$ step ->execute ();
147
147
}
148
148
149
+ public function testExecuteTypeStringLevel ()
150
+ {
151
+ $ this ->expectException (StepException::class);
152
+ $ this ->expectExceptionMessage ('Fix configuration with given suggestions ' );
153
+
154
+ $ this ->loggerMock ->expects ($ this ->once ())
155
+ ->method ('notice ' )
156
+ ->with ('Validating configuration ' );
157
+ $ this ->loggerMock ->expects ($ this ->exactly (2 ))
158
+ ->method ('log ' )
159
+ ->withConsecutive (
160
+ [
161
+ Logger::NOTICE ,
162
+ 'Fix configuration with given suggestions: '
163
+ . PHP_EOL . '- some notice '
164
+ . PHP_EOL . ' some notice suggestion '
165
+ ],
166
+ [
167
+ Logger::WARNING ,
168
+ 'Fix configuration with given suggestions: '
169
+ . PHP_EOL . '- some warning '
170
+ . PHP_EOL . ' some warning suggestion '
171
+ ]
172
+ );
173
+
174
+ $ step = new ValidateConfiguration (
175
+ $ this ->loggerMock ,
176
+ [
177
+ 'critical ' => [
178
+ $ this ->createValidatorWithError ('Critical error ' , 'some critical suggestion ' ),
179
+ ],
180
+ 'warning ' => [
181
+ $ this ->createValidatorWithError ('some warning ' , 'some warning suggestion ' ),
182
+ ],
183
+ 'notice ' => [
184
+ $ this ->createValidatorWithError ('some notice ' , 'some notice suggestion ' ),
185
+ ],
186
+ ]
187
+ );
188
+ $ step ->execute ();
189
+ }
190
+
149
191
/**
150
192
* @param string $error
151
193
* @param string $suggestion
You can’t perform that action at this time.
0 commit comments