Launch Bash Tests.
This image uses the official bats/bats image in addition with some common helper libraries
bats-support
(formerlybats-core
) - supporting library for test helpersbats-assert
- common assertionsbats-file
- filesystem related assertions
Test:
stage: Code Quality
dependencies: []
image: ghcr.io/socialgouv/docker/bats
script:
- bats -t test
# To run your local test folder
$ docker run --rm -v "$(pwd):/app" ghcr.io/socialgouv/docker/bats /app/test
# To run Bats' internal test suite (which is in the container image at /opt/bats/test):
$ docker run --rm ghcr.io/socialgouv/docker/bats /opt/bats/test
# To run Bats assert' internal test suite (which is in the container image at /usr/lib/bats-assert/test):
$ docker run --rm ghcr.io/socialgouv/docker/bats /usr/lib/bats-assert/test
# To run Bats file' internal test suite (which is in the container image at /usr/lib/bats-file/test):
$ docker run --rm ghcr.io/socialgouv/docker/bats /usr/lib/bats-file/test