mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-03 10:37:21 +09:00
§3 bans test-level EXIT traps because such a trap displaces the handler the bats binary installs, so a failing test prints no TAP line and a grep for `not ok` reads a green suite. That is true, and it is unreachable in CI. hack/cozytest.sh runs each @test inside an explicit subshell and reads the status out of band on the next line, so a trap in a test body fires when that subshell exits and takes nothing with it. The real bats binary is invoked nowhere in the tree -- make bats-unit-tests and every recipe in packages/core/testing/Makefile go through cozytest.sh. The disappearing `not ok` needs someone running bats by hand. Worth writing down because the rule has cost four PRs and three successive mechanisms, and the omission reads as an unpaid backlog: 68 declared traps that a reader assumes CI is one refactor away from needing. It is a review aid over a hazard outside CI. The note also records that two of the covered files resist a mechanical conversion, so the next person to try does not discover it halfway. No other line of the document changes. Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>