Bats Core Versions Save

Bash Automated Testing System

v1.11.0

1 month ago

Added:

  • hardened CI scripts by using hashes instead of versions for actions and restricting permissions (#754, #770)
  • add security.md (#762)
  • add codespell CI checks (#720)
  • dynamic test registration via bats_test_function (#349)
  • add check that Bats is executed with Bash >= 3.2 (#873)

Fixed:

  • install.sh now works for deviating lib/ dirs (like lib32,lib64) (#487)
  • catch unset BATS_TEST_SOURCE in lib/bats-core/tracing.bash so set -u/set -o nounset works as expected (#827)
  • fix --gather-test-outputs-in fails on tests with multiple / (#789)
  • install does not create unused /usr/share/bats anymore (#857)
  • ensure IFS is unchanged in {setup,teardown}{_suite,_file,}, @test and free code (#879)
  • junit formatter: remove ANSI Codes to avoid invalid XML character (#886)

Changed:

  • update Docker image with the latest bats-file version 0.4.0 (#780)
  • update Docker image with the latest bats-detik version 1.3.0 (#876)

Documentation

  • clarify docker usage (#741)
  • update Arch Linux package URL in installation.rst (#821)
  • rename bash-bats to bats for Arch Linux in installation.rst (#836)
  • fix FAQ entry about setup-/teardown_suite, as they are available now (#861)
  • added logo (#881)

v1.11.0-RC2

2 months ago

Fixes compared to RC1:

  • static tests are now interleaved with dynamic tests in the order they were declared in the file (#860)
  • setting PATH in free code does not break bats-gather-tests anymore (#858)

Please report problems in the associated discussion page.

v1.11.0-RC1

3 months ago

Due to the extensive changes necessary for the dynamic test registration, this is first released as a candidate for users to check if it works as intended.

Added

  • hardened CI scripts by using hashes instead of versions for actions and restricting permissions (#754, #770)
  • add security.md (#762)
  • add codespell CI checks (#720)
  • dynamic test registration via bats_test_function (#349)

Fixed

  • install.sh now works for deviating lib/ dirs (like lib32,lib64) (#487)
  • catch unset BATS_TEST_SOURCE in lib/bats-core/tracing.bash so set -u/set -o nounset works as expected (#827)
  • fix --gather-test-outputs-in fails on tests with multiple / (#789)

Changed

  • update Docker image with the latest bats-file version 0.4.0 (#780)
  • update Docker image with the latest bats-detik version 1.2.1 (#810)

Documentation

  • clarify docker usage (#741)
  • update Arch Linux package URL in installation.rst (#821)
  • rename bash-bats to bats for Arch Linux in installation.rst (#836)

v1.10.0

10 months ago

Added:

  • add ${BATS_TEST_TAGS[@]} for querying the tags during a test (#705)
  • print tags on failing tests (#705)
  • test for negative arguments to --jobs (#693)
  • add tests for --formatter cat (#710)
  • test coverage in CI (#718)
  • Support for rush as alternative to GNU parallel (#729)
  • add bats_pipe helper function for run that executes \| as pipes (#663)
  • publish docker images to ghcr.io (additionally to Dockerhub) (#740)

Documentation:

  • clarify use cases of --formatter cat (#710)

Fixed:

  • fix run with options overwriting the value of i (#726, #727)
  • fix ${BATS_TEST_NAMES[@]} containing only --tags instead of test name since Bats v1.8.0 (#705)
  • fix run --keep-empty-lines counting trailing \n as (empty) new line (#711)
  • fix short flag unpacker creating bogus command lines with valued flags (#732)
  • fix formatter becoming confused with retries (#734)
  • fix --gather-test-outputs-in fails on tests with / (#735)
  • fix overriding date breaks --timing (#736)

Documentation

  • typos, minor edits (#704)
  • simplified contributing.md (#718)

v1.9.0

1 year ago

Added:

  • add installation instructions for Debian, Fedora, Gentoo, and OpenSUSE (#659)
  • add --line-reference-format to switch file/line references in stack traces (#665)
    • comma_line (default): file.bats, line 1
    • colon: file.bats:1
    • uri: file:///path/to/file.bats:1
    • custom: define your own formatter in bats_format_file_line_reference_custom
  • add bats:focus tag to run only focused tests (#679)
  • add bats-support, bats-assert, bats-file and bats-detik to Dockerfile (#674)

Documentation:

  • add --help text and man page content for --filter-tags (#679)

Fixed:

  • explicitly check for GNU parallel (#691)
  • wait for report-formatter to finish before ending bats' execution, to fix empty files with --report-fomatter junit under Docker (#692)

Documentation

  • improved clarity of section about output in free code (#671)
  • fixed typos (#673)
  • clarify use cases of run (#366)

v1.8.2

1 year ago

Bats 1.8.2

Released: 2022-10-19

Fixed:

  • fix non zero return code on successful retried tests (#670)

v1.8.1

1 year ago

Bats 1.8.1

Released: 2022-10-19

Fixed:

  • shfmt all files and enforce via CI (#651)
  • avoid kernel warning flood/hang with CTRL+C on Bash 5.2 RC (#656)
  • Fix infinite wait with (invalid) -j<n> (without space) (#657)

v1.8.0

1 year ago

Bats 1.8.0

Released: 2022-09-15

Added:

  • using external formatters via --formatter <absolute path> (also works for --report-formatter) (#602)
  • running only tests that failed in the last run via --filter-status failed (#483)
  • variable BATS_TEST_RETRIES that specifies how often a test should be reattempted before it is considered failed (#618)
  • Docker tags latest-no-faccessat2 and <bats-version\>-no-faccessat2 for avoiding bash: bats: No such file or directory on docker<20.10 (or runc<v1.0.0-rc93) (#622)
  • BATS_TEST_TIMEOUT variable to force a timeout on test (including setup()) (#491)
  • also print (nonempty) $stderr (from run --separate-stderr) with --print-output-on-failure (#631)
  • # bats test_tags=<tag list>/# bats file_tags=<tag list> and --filter-tags <tag list> for tagging tests for execution filters (#642)
  • warning BW03: inform about setup_suite in wrong file (.bats instead of setup_suite.bash) (#652)

Documentation

  • update gotcha about negated statements: Recommend using run ! on Bats versions >=1.5.0 (#593)
  • add documentation for bats_require_minimum_version (#595)
  • improve documentation about setup_suite (#652)

Fixed:

  • added missing shebang (#597)
  • remaining instances of run -<N> being incorrectly documented as run =<N> (#599)
  • allow --gather-test-outputs-in <directory> to work with existing, empty directories (#603)
    • also add --clean-and-gather-test-outputs-in <directory> for improved UX
  • double slashes in paths derived from TMPDIR on MacOS (#607)
  • fix load in teardown marking failed tests as not run (#612)
  • fix unset variable errors (with set -u) and add regression test (#621)
  • teardown_file errors don't swallow setup_file errors anymore, the behavior is more like teardown's now (only return/last command can trigger teardown errors) (#623)
  • upgraded from deprecated CI envs for MacOS (10 -> 11,12) and Ubuntu (18.04 -> 22.04) (#630)
  • add /usr/lib/bats as default value for BATS_LIB_PATH (#628)
  • fix unset variable in bats-formatter-junit when setup_file fails (#632)
  • unify error behavior of teardown/teardown_file/teardown_suite functions: only fail via return code, not via ERREXIT (#633)
  • fix unbound variable errors with set -u on setup_suite failures (#643)
  • fix load not being available in setup_suite (#644)
  • fix RPM spec, add regression test (#648)
  • fix handling of IFS by run (#650)
  • only print setup_suite's stderr on errors (#649)

Documentation

  • fix typos, spelling and links (#596, #604, #619, #627)
  • fix redirection order of an example in the tutorial (#617)

v1.7.0

2 years ago

Bats 1.7.0

Released: 2022-05-14

Added:

  • Pretty formatter print filename when entering file (#561)
  • BATS_TEST_NAME_PREFIX allows prefixing test names on stdout and in reports (#561)
  • setup_suite and teardown_suite (#571, #585)
  • out-of-band warning infrastructure, with following warnings:
    • BW01: run command not found (exit code 127) (#586)
    • BW02: run uses flags without proper bats_require_minimum_version guard (#587)
  • bats_require_minimum_version to guard code that would not run on older versions (#587)

Documentation

  • document $BATS_VERSION (#557)
  • document new warning infrastructure (#589, #587, #586)

Fixed:

  • unbound variable errors in formatters when using SHELLOPTS=nounset (-u) (#558)
  • don't require flock and shlock for parallel mode test (#554)
  • print name of failing test when using TAP13 with timing information (#559, #555)
  • removed broken symlink, added regression test (#560)
  • don't show empty lines as # with pretty formatter (#561)
  • prevent teardown, teardown_file, and teardown_suite from overriding bats' exit code by setting $status (e.g. via calling run) (#581, #575)
    • CRITICAL: this can return exit code 0 despite failed tests, thus preventing your CI from reporting test failures! The regression happened in version 1.6.0.
  • run --keep-empty-lines now reports 0 lines on empty $output (#583)

Documentation

  • remove 2018 in title, update copyright dates in README.md (#567)
  • fix broken links (#568)
  • corrected invalid documentation of run -N (had =N instead) (#579)
    • CRITICAL: using the incorrect form can lead to silent errors. See issue #578 for more details and how to find out if your tests are affected.

v1.6.1

2 years ago

Bats 1.6.1

Released: 2022-05-14

Fixed:

  • prevent teardown, teardown_file, and teardown_suite from overriding bats' exit code by setting $status (e.g. via calling run) (#581, #575)
    • CRITICAL: this can return exit code 0 despite failed tests, thus preventing your CI from reporting test failures! The regression happened in version 1.6.0.

Documentation

  • corrected invalid documentation of run -N (had =N instead) (#579)
    • CRITICAL: using the incorrect form can lead to silent errors. See issue #578 for more details and how to find out if your tests are affected.