Skip to content

test: cozytest.sh stops a bats file at its first failing test #4620

Open

Description

hack/cozytest.sh stops a bats file at its first failing test, so the tests after it never run and never report. A red run shows one failure when there may be several, and a fix for the first one is the only way to find out about the next.

The cause is in run_one: on a non-zero test status it prints the captured output and then runs exit "$rc", which ends the whole file instead of the test. I reproduced it on main with hack/image-builders-cross-compile.bats and one deliberately broken pattern: the file printed two passes and one failure, and tests 4 and 5 never ran.

This is the in-file half of #3692. The make-level half, where make bats-unit-tests stops at the first failing file, is fixed separately.

Fix shape: record the failure in run_one and keep going, then exit with the recorded status after the last test. Open PR #3933 also edits hack/cozytest.sh, and #3849 moves the unit suites to vanilla Bats, which would make this moot for them. Whichever lands first decides where this belongs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/testingIssues or PRs related to testing (e2e, bats, unit tests)kind/bugCategorizes issue or PR as related to a bugtriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions