7b0b697b18
- Crea functions/infra/audit_e2e_coverage.go: AuditE2ECoverage(roots) escanea
app.md recursivamente, detecta e2e_checks: en frontmatter, retorna
E2ECoverageReport{total, with_checks, missing, coverage_pct}.
- Crea functions/infra/e2e_coverage_report.go: tipo E2ECoverageReport con
JSON tags (total, with_checks, missing, coverage_pct).
- Crea types/infra/e2e_coverage_report.md: metadata del tipo para registry.
- Crea functions/infra/audit_e2e_coverage.md: documentacion self-contained
con Ejemplo, Cuando usarla, Gotchas.
- Crea functions/infra/audit_e2e_coverage_test.go: 3 tests (empty, all-covered,
partial) — todos pasan.
- Edita cmd/fn/doctor.go: agrega case "e2e-coverage" -> doctorE2ECoverage().
Output text (tabla tabwriter + lista de apps missing) y --json (E2ECoverageReport).
Acceptance verificado:
fn doctor e2e-coverage --json -> {total, with_checks, missing, coverage_pct} OK
fn doctor e2e-coverage -> tabla text OK
go test ./functions/infra/... -> 3/3 PASS
fn show audit_e2e_coverage_go_infra -> indexada OK
task_run: task_d285372493cce2e6 iter 1
Co-authored-by: fn-orquestador <noreply@fn-registry>
2.3 KiB
2.3 KiB
name, kind, lang, domain, version, purity, signature, description, tags, params, output, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | params | output | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| audit_e2e_coverage | function | go | infra | 1.0.0 | impure | func AuditE2ECoverage(roots []string) (E2ECoverageReport, error) | Escanea directorios en busca de app.md y reporta cuales declaran e2e_checks en su frontmatter YAML. Retorna total, with_checks, missing (paths relativos) y coverage_pct (0-100). Impuro por lectura de filesystem. |
|
|
E2ECoverageReport con total/with_checks/missing/coverage_pct. Error no nil solo ante fallo real de I/O. |
|
|
false | error_go_core |
|
true |
|
functions/infra/audit_e2e_coverage_test.go | functions/infra/audit_e2e_coverage.go |
Ejemplo
report, err := infra.AuditE2ECoverage([]string{"apps", "cpp/apps", "projects"})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Coverage: %.2f%% (%d/%d apps)\n", report.CoveragePct, report.WithChecks, report.Total)
for _, m := range report.Missing {
fmt.Println(" missing:", m)
}
Cuando usarla
Usar como backend de fn doctor e2e-coverage para detectar apps sin contrato de validacion.
Tambien util antes de crear proposals e2e_check_add: llamar primero para obtener la lista
de apps que necesitan cobertura y priorizar las que mas se usan.
Gotchas
- Solo detecta
e2e_checks:como substring en el frontmatter — no valida la estructura YAML completa del bloque. Un# e2e_checks:comentado pasaria como cubierto. - Los paths en
Missingson los paths tal como los devuelvefilepath.WalkDir, que pueden ser absolutos si los elementos derootsson absolutos. Para comparacion reproducible, pasar roots relativas al cwd. - Un
app.mdno legible (permisos) se cuenta enTotaly se añade aMissing— no aborta el scan.