47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.8 KiB
2.8 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | params | output | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| e2e_run_checks | function | go | infra | 1.0.0 | impure | func E2ERunChecks(checks []E2ECheck, workDir string) ([]CheckResult, error) | Ejecuta una lista de E2ECheck en orden y retorna un CheckResult por check. Soporta comandos de shell (via bash -c), health checks HTTP, y referencias a otros artefactos (Ref, actualmente skip). Los checks individuales que fallan no abortan la ejecucion del resto. |
|
|
|
false | error_go_core |
|
true |
|
functions/infra/e2e_run_checks_test.go | functions/infra/e2e_run_checks.go |
|
Slice de CheckResult con un resultado por cada check de entrada. El error solo indica fallo de infraestructura (imposible iniciar el proceso, workDir invalido), no fallos individuales de checks. |
Ejemplo
zero := 0
checks := []infra.E2ECheck{
{ID: "api-alive", Health: "http://localhost:8080/health", TimeoutS: 30},
{ID: "data-ok", Cmd: "psql $DB_URL -c 'SELECT 1'", ExpectExit: &zero},
{ID: "schema-v3", Cmd: "migrate status", ExpectStdoutContains: "version: 3"},
}
results, err := infra.E2ERunChecks(checks, "/opt/apps/myapp")
for _, r := range results {
fmt.Printf("%s: %s (%dms)\n", r.ID, r.Status, r.DurationMs)
}
Comportamiento por tipo de check
| Campo presente | Comportamiento |
|---|---|
Solo Cmd (foreground) |
Ejecuta con bash -c, captura stdout/stderr, evalua ExpectExit y ExpectStdoutContains |
Cmd terminando en & |
Lanza en background, no espera exit, pasa inmediatamente al paso Health |
Solo Health |
Sondea el endpoint HTTP hasta 200 o timeout |
Cmd + Health |
Ejecuta Cmd primero, luego sondea Health |
Solo Ref |
skip con error "ref handler not implemented" |
| Ninguno | skip |
Notas
Los comandos background (terminan en &) son utiles para iniciar servicios y luego verificar su salud via Health. Se asume exit 0 inmediato; si el proceso no levanta antes del timeout del health check, el check falla.
Stdout y stderr se truncan a 4KB por check para evitar resultados excesivamente grandes.
La implementacion de Ref (cross-service checks) esta reservada para issue posterior.