Skip to content

For tests that pass but which were retried, bats returns non-zero exit code  #660

@djmcgreal-cc

Description

@djmcgreal-cc

To Reproduce

echo '
@test "fail once" {
    BATS_TEST_RETRIES=2
    ((BATS_TEST_TRY_NUMBER > 1)) || false
}
' > tst.bats
bats tst.bats
[ "$?" -eq 0 ] && echo 'reported success' || echo 'reported failure'

Expected behavior

reported success should be printed, as per the test output

Environment (please complete the following information):

  • Bats Version: 1.8
  • OS: MacOS
  • Bash version: [e.g. 5.1] 3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: Bash CodeEverything regarding the bash codePriority: CriticalBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorSize: SmallChanges to a few localized lines of code (e.g. same function)Type: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions