balena-supervisor/docker-compose.test.yml
Felipe Lalanne 18c2f8cec9 Migrate lib/legacy tests to integration tests
This also sets up a dbus container as part of the test environment. This
container exposes a socket that the sut container can use
2022-09-28 10:37:41 -03:00

51 lines
1.3 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
dbus:
build:
context: ./test/lib/dbus/
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
- dbus
# Set required supervisor configuration variables here
environment:
DOCKER_HOST: tcp://docker:2375
DBUS_SYSTEM_BUS_ADDRESS: tcp:host=dbus,port=6667,family=ipv4
# Required by migrations
CONFIG_MOUNT_POINT: /mnt/root/mnt/boot/config.json
# Read by constants to setup `bootMountpoint`
BOOT_MOUNTPOINT: /mnt/boot
# 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/root