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

Aberta
#2,303 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
55/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
bash
Domínio
testing

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
C
Estrelas
3
Forks
7
Merge médio
6h 32min
PRs com merge (30d)
285

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de InauguralSystems/EigenScript

Todas as issues de InauguralSystems/EigenScript

Issues semelhantes

Mais issues de C

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.