feat(compat): declare core independence with core:"none" (INDEPENDENT status, block inheritance, no warning)
This commit is contained in:
@@ -9,9 +9,9 @@ $GLOBALS['g11_repo'] = dirname(__DIR__);
|
||||
/**
|
||||
* Contratos:
|
||||
* - levels.json debe cubrir exactamente los componentes del catalogo.
|
||||
* - si tests/compat/report.json existe, todo 'tested' declarado debe estar
|
||||
* respaldado por un 'ok' del reporte, y los niveles 'none' no deben
|
||||
* declarar tested.
|
||||
* - si tests/compat/report.json existe: todo 'tested' declarado debe estar
|
||||
* respaldado por un 'ok' del reporte, y el nivel 'none' de evidencia debe
|
||||
* coincidir con la declaracion 'core: none' del manifiesto (bidireccional).
|
||||
* Sin reporte (entorno offline sin haber corrido el barrido) solo se exige el
|
||||
* primer contrato.
|
||||
*/
|
||||
@@ -51,19 +51,25 @@ Harness::it('los stamps tested estan respaldados por el reporte del barrido', fu
|
||||
$report = json_decode((string) file_get_contents($reportPath), true);
|
||||
ok(is_array($report) && isset($report['components']), 'report.json valido');
|
||||
|
||||
$levels = json_decode((string) file_get_contents($repo . '/tests/compat/levels.json'), true);
|
||||
$catalog = Catalog::fromRoot($repo);
|
||||
$levels = json_decode((string) file_get_contents($repo . '/tests/compat/levels.json'), true);
|
||||
$catalog = Catalog::fromRoot($repo);
|
||||
|
||||
foreach ($catalog->packages() as $manifest) {
|
||||
foreach (array_keys($manifest->components()) as $component) {
|
||||
$id = $manifest->name . ':' . $component;
|
||||
$level = $levels[$manifest->name][$component] ?? null;
|
||||
$level = is_array($level) ? $level['level'] : $level;
|
||||
$status = $report['components'][$id]['status'] ?? 'missing';
|
||||
$tested = $manifest->testedCore($component);
|
||||
$id = $manifest->name . ':' . $component;
|
||||
$level = $levels[$manifest->name][$component] ?? null;
|
||||
$level = is_array($level) ? $level['level'] : $level;
|
||||
$status = $report['components'][$id]['status'] ?? 'missing';
|
||||
$tested = $manifest->testedCore($component);
|
||||
$independ = $manifest->coreIndependent($component);
|
||||
|
||||
if ($level === 'none') {
|
||||
eq(null, $tested, "$id esta deliberadamente sin datos y no debe declarar tested");
|
||||
ok($independ, "$id esta sin evidencia de barrido y debe declarar core none");
|
||||
}
|
||||
|
||||
if ($independ) {
|
||||
eq('none', $level, "$id se declara independiente y su nivel debe ser none");
|
||||
eq(null, $tested, "$id independiente no puede declarar tested");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user