tests: a path-named or launcher-exec'd command that does not exist (rc 127) still fails open in a suite fragment

Abierto
#2,303 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bash
Área
testing

Línea de trabajo

Start in tests/run_all_tests.sh, where command_not_found_handle is defined and where fragments are sourced, including the . f || exit 1 line that suppresses ERR inside a fragment. Reproduce with the plant "$TESTS_DIR/does_not_exist_plant.sh" added to tests/sections/1a7-sandbox-source-budgets.sh, run via EIGS_SUITE_SECTIONS='1a7' bash run_all_tests.sh. Done when a path-named or launcher-exec'd missing command (rc 126/127) prints a FAIL naming the section and path and the run exits nonzero, with a selftest that goes green when the check is removed.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:gates kind:gate-defect

Follow-up to the hq#58 [1a7] fix (InauguralSystems/hq#58, PR claude/ci58-es-2a-fragments).

That PR makes tests/run_all_tests.sh define command_not_found_handle, so a bare name that does not exist (run_test ...) fails its section. bash calls that hook only for PATH lookups. A path-named command that does not exist never reaches it:

$ bash -c 'command_not_found_handle(){ echo HOOK; }; ./nope; echo rc=$?'
bash: line 1: ./nope: No such file or directory
rc=127

So a fragment statement such as "$TESTS_DIR/test_renamed_away.sh" or ./tools/gone.sh (statement position, rc unchecked) prints an error, sets rc 127 and the section still passes. The same is true of a name exec'd by a launcher (timeout 30 missing_cmd, env X=1 missing_cmd), which exits 127 from the launcher with no hook call.

Repro (plant)

Add "$TESTS_DIR/does_not_exist_plant.sh" as a statement line to any fragment, e.g. tests/sections/1a7-sandbox-source-budgets.sh, then cd tests && EIGS_SUITE_SECTIONS='1a7' bash run_all_tests.sh; echo rc=$? -> No such file or directory, RESULTS: N/N passed, rc=0.

Done when
  • The plant above, run through the real runner (sourced path and EIGS_SUITE_SECTIONS plan path), prints a FAIL naming the section and the missing path, and the run exits nonzero.
  • The same holds for timeout 30 missing_cmd_plant in statement position (rc 127 from a launcher).
  • A selftest drives both plants through the real runner and also shows them green with the new check gutted (the check is the witness).
  • The full suite on Linux shows no new false FAIL (no fragment today legitimately leaves rc 126/127 unchecked, or each such site is fixed in the same PR).

Candidate mechanism: an ERR trap (or a per-statement rc 126/127 check) active while a fragment is sourced; note . f || exit 1 suppresses ERR inside f, so the sourcing line must change.


Generated by Claude Code

Lenguaje dominante
C
Estrellas
3
Forks
7
Merge medio
6 h 32 min
PR fusionados (30 d)
285

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de InauguralSystems/EigenScript

Todos los issues de InauguralSystems/EigenScript

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.