| `bats-libraries` / `BASH_BATS_LIBRARIES` | Coma separated list of Bats [libraries and add-ons](https://bats-core.readthedocs.io/en/stable/writing-tests.html#libraries-and-add-ons)(formatted as `lib_name_1@archive_url_1 lib_name_2@archive_url_2 ...`) | _none_ |
| `coverage-enabled` / `BASH_COVERAGE_ENABLED` | Set to `true` to enable coverage measurement. [Using Bashcov](https://github.com/infertux/bashcov) | `false` |
| `coverage-formatters` / `BASH_COVERAGE_FORMATTERS` | Comma separated list of coverage report [formatters](https://github.com/simplecov-ruby/simplecov/blob/main/doc/alternate-formatters.md) and optional library/package name. Formatted as: `package-name1@formatter-class1, package-name2@formatter-class2 ...` | `SimpleCov::Formatter::SimpleFormatter` |
| `coverage-track-files` / `BASH_COVERAGE_TRACK_FILES` | Glob pattern of files to track coverage | `**/*.sh` |
| `coverage-filters` / `BASH_COVERAGE_FILTERS` | Comma separated list of files and directories to filter out from your coverage data (e.g. 'tests/*, .tools' ). | _none_ |
In addition to a textual report in the console, this job produces the following reports, kept for one day:
Code coverage with Bats is based on [BashCov](https://github.com/infertux/bashcov) which is a wrapper around [SimpleCov](https://github.com/simplecov-ruby/simplecov?tab=readme-ov-file#maximum-coverage-drop) for Bash.
In order to access advanced configuration features (for example quality gate with minimum line/branch coverage, maximum coverage drop or else) all you have to do is to commit your own .simplecov configuration to the root of your Git repository.
Doing so, be aware that the template implementation expects some configuration to be set. Here is a basic .simplecov that you may use as a starting point to build your own:
```ruby
# /!\ MANDATORY for using bashcov and to-be-continuous
require'simplecov'
require'simplecov-cobertura'
# import additional libraries / plugins here (e.g. 'simplecov-csv')
SimpleCov.startdo
# /!\ MANDATORY for to-be-continuous
coverage_dir'reports'
# Can be customized
track_files'**/*.sh'
# Can be customized with your own formatters
# /!\ CoberturaFormatter is MANDATORY for the gitlab reporting of to-be-continuous