diff --git a/.drone.yml b/.drone.yml index dcc19c6..de34588 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,16 +8,38 @@ services: environment: POSTGRES_PASSWORD: test POSTGRES_DB: test + - name: postgresql2 + image: docker.io/postgres:13.1-alpine + environment: + POSTGRES_PASSWORD: test2 + POSTGRES_DB: test + POSTGRES_USER: postgres2 + commands: + - -p 5433 - name: mysql image: docker.io/mariadb:10.5 environment: MYSQL_ROOT_PASSWORD: test MYSQL_DATABASE: test + - name: mysql2 + image: docker.io/mariadb:10.5 + environment: + MYSQL_ROOT_PASSWORD: test2 + MYSQL_DATABASE: test + commands: + - --port=3307 - name: mongodb image: docker.io/mongo:5.0.5 environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: test + - name: mongodb2 + image: docker.io/mongo:5.0.5 + environment: + MONGO_INITDB_ROOT_USERNAME: root2 + MONGO_INITDB_ROOT_PASSWORD: test2 + commands: + - --port=27018 clone: skip_verify: true diff --git a/tests/end-to-end/test_dev_parity_with_build_server.py b/tests/end-to-end/test_dev_parity_with_build_server.py new file mode 100644 index 0000000..b555490 --- /dev/null +++ b/tests/end-to-end/test_dev_parity_with_build_server.py @@ -0,0 +1,22 @@ +import ruamel.yaml + + +def test_dev_docker_compose_has_same_services_as_build_server_configuration(): + yaml = ruamel.yaml.YAML(typ='safe') + dev_services = { + name: service + for name, service in yaml.load(open('tests/end-to-end/docker-compose.yaml').read())['services'].items() + if name != 'tests' + } + build_server_services = tuple(yaml.load_all(open('.drone.yml').read()))[0]['services'] + + assert len(dev_services) == len(build_server_services) + + for build_service in build_server_services: + dev_service = dev_services[build_service['name']] + assert dev_service['image'] == build_service['image'] + assert dev_service['environment'] == build_service['environment'] + + if 'command' in dev_service or 'commands' in build_service: + assert len(build_service['commands']) <= 1 + assert dev_service['command'] == build_service['commands'][0]