Skip to content

Emtemf/api-codegen REV-2026-003: Make run-all-tests.sh fail closed with pipefail #14

Description

@Emtemf

finding_id: REV-2026-003
priority: P0
area: ci
kind: ci
paths:

  • run-all-tests.sh
  • git-hooks/pre-commit
    blocked_by: []
    automation: needs-design

Summary

Make run-all-tests.sh fail closed when any piped test command fails, so the pre-commit hook cannot report success after a failed test.

Evidence

Global review finding REV-2026-003 identified a pipeline without pipefail in run-all-tests.sh, with git-hooks/pre-commit consuming its result.

Impact

Broken tests can be masked by a successful final pipeline command, allowing invalid changes to pass local pre-commit checks.

Scope

Enable fail-closed pipeline semantics, preserve existing per-module summary output, and add a regression test with an intentionally failing pipeline command.

Out of scope

Changes to test modules, CI provider migration, or unrelated hook policy.

Acceptance criteria

  • 管道前置命令失败时脚本返回非零
  • pre-commit 不会把失败测试判定为通过
  • 增加故意失败命令的脚本回归验证
  • 不改变现有测试模块汇总输出

Verification

Run the script and pre-commit hook against passing and intentionally failing pipeline fixtures; assert exit codes and compare the normal summary format.

Rollback

Revert shell error-handling and regression-test changes if they reveal an incompatible shell environment, then document the supported shell requirement.

Dependencies

None. Keep this issue labeled automation:needs-design; do not add automation:ready until design review is complete.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions