I'm using docker-compose to run tests for my app. My docker-compose.yml file has three services, one for mongodb, one for my app, and a third for my tests. I have logging: driver: "none" set for the app and mongodb because I only want to see the test logs.
This previously worked as expected. Since the last time I worked on this project, I've upgraded docker desktop on my mac to Version 3.5.2 (3.5.2.18). Now, all container logs flood my terminal when running. I'm not sure what has changed.
version: '3.1'
services:
mongodb:
image: mongo
expose:
- 27017
logging:
driver: "none"
rsscloud:
build: .
command: node --use_strict app.js
environment:
DOMAIN: rsscloud
PORT: 5337
MONGODB_URI: mongodb://mongodb:27017/rsscloud
NODE_TLS_REJECT_UNAUTHORIZED: 0
expose:
- 5337
depends_on:
- mongodb
logging:
driver: "none"
rsscloud-tests:
build: .
command: dockerize -wait tcp://mongodb:27017 -wait http://rsscloud:5337 -timeout 10s bash -c "npm test"
environment:
APP_URL: http://rsscloud:5337
MONGODB_URI: mongodb://mongodb:27017/rsscloud
MOCK_SERVER_DOMAIN: rsscloud-tests
MOCK_SERVER_PORT: 8002
SECURE_MOCK_SERVER_PORT: 8003
volumes:
- ./xunit:/app/xunit
expose:
- 8002
- 8003
depends_on:
- mongodb
- rsscloud
I run docker compose up --build --abort-on-container-exit
Here is a sample of the output:
Attaching to mongodb_1, rsscloud-tests_1, rsscloud_1
rsscloud-tests_1 | 2021/07/27 15:43:58 Waiting for: tcp://mongodb:27017
rsscloud-tests_1 | 2021/07/27 15:43:58 Waiting for: http://rsscloud:5337
rsscloud-tests_1 | 2021/07/27 15:43:58 Connected to tcp://mongodb:27017
mongodb_1 | {"t":{"$date":"2021-07-27T15:43:58.964+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:39890","uuid":"d9874a7d-e9c3-4e88-b163-c9b9deb582d1","connectionId":2,"connectionCount":2}}
rsscloud-tests_1 | 2021/07/27 15:43:58 Received 200 from http://rsscloud:5337
rsscloud_1 | [15:43:58.993] GET / 200 577 - ::ffff:172.18.0.4 - 20.885 ms
rsscloud-tests_1 |
rsscloud-tests_1 | > rsscloud-server@2.0.0 test /app
rsscloud-tests_1 | > mocha -R mocha-multi --reporter-options spec=-,xunit=xunit/test-results.xml --timeout 10000
rsscloud-tests_1 |
rsscloud-tests_1 |
rsscloud-tests_1 |
rsscloud-tests_1 | Ping XML-RPC to http-post returning XML
mongodb_1 | {"t":{"$date":"2021-07-27T15:44:00.100+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:39892","uuid":"df65fb3a-9913-4075-9671-34d2e9a4d7e8","connectionId":3,"connectionCount":3}}
mongodb_1 | {"t":{"$date":"2021-07-27T15:44:00.105+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn3","msg":"client metadata","attr":{"remote":"172.18.0.4:39892","client":"conn3","doc":{"driver":{"name":"nodejs","version":"4.0.1"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.25-linuxkit"},"platform":"Node.js v12.22.3, LE (unified)|Node.js v12.22.3, LE (unified)"}}}
rsscloud-tests_1 | → MongoDB 'rsscloud' Database Connected
rsscloud-tests_1 | → Mock server started on port: 8002
rsscloud-tests_1 | → Mock secure server started on port: 8003