mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-21 14:37:49 +00:00
6d004f0994
This allows to run integration tests during development and on CI with the right dependencies. There are several changes that this involves, but the gist of it is that a test environment is setup using `docker-compose.test.yml`. This file is loaded by `resin-ci` during the build, and ensures that integration tests are ran after setting up all requirements. This commit also defines a test environment command that can be setup using `npm run test:env` in order to run tests in a local development machine.
41 lines
1.0 KiB
YAML
41 lines
1.0 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.null
|
|
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
|
|
# 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
|