balena-supervisor/docker-compose.test.yml
Felipe Lalanne 4113dde45d Split compose/volume tests into unit/integration
This also needs to modify the test environment as database migrations
will look for `config.json` in the location given by the variable
`CONFIG_MOUNT_POINT`.

The volume tests now run against the actual docker engine setup via dind

Change-type: patch
2022-09-28 10:37:40 -03:00

44 lines
1.1 KiB
YAML

version: '2.3'
services:
# Override the supervisor service configuration. The tests will
# be run through the `sut` service
balena-supervisor:
build:
dockerfile: Dockerfile
context: ./
command: sleep infinity
docker:
image: docker:dind
privileged: true
environment:
DOCKER_TLS_CERTDIR: ''
command: --tls=false --debug
sut:
# Build the supervisor code for development and testing
build:
context: ./
dockerfile: Dockerfile.template
target: test
args:
# Change this if testing in another architecture
ARCH: amd64
depends_on:
- balena-supervisor
- docker
# Set required supervisor configuration variables here
environment:
DOCKER_HOST: tcp://docker:2375
# Required by migrations
CONFIG_MOUNT_POINT: /mnt/boot/config.json
# Set required mounts as tmpfs or volumes here
# if specific files need to be backed up between tests,
# make sure to add them to the `testfs` configuration under
# .mochapodrc.yml
tmpfs:
- /data
- /mnt/boot
- /mnt/root