ci: healthcheck for mysqldb

This commit is contained in:
Dave Horton
2020-12-14 13:36:29 -05:00
parent fdf334ec61
commit 3d2178897c
3 changed files with 11 additions and 10 deletions

View File

@@ -12,11 +12,9 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: docker pull drachtio/sipp:latest
- run: npm install
- run: npm run jslint
- name: run tests
run: DEBUG=jambonz:* npm test
shell: bash {0}
- run: pwd
- run: DEBUG=jambonz:* npm test

View File

@@ -14,6 +14,10 @@ services:
- "3306:3306"
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "--protocol", "tcp"]
timeout: 5s
retries: 10
networks:
sbc-outbound:
ipv4_address: 172.39.0.2
@@ -26,6 +30,9 @@ services:
networks:
sbc-outbound:
ipv4_address: 172.39.0.10
depends_on:
mysql:
condition: service_healthy
redis:
image: redis:5-alpine

View File

@@ -4,12 +4,8 @@ const exec = require('child_process').exec ;
test('starting docker network..', (t) => {
exec(`docker-compose -f ${__dirname}/docker-compose-testbed.yaml up -d`, (err, stdout, stderr) => {
// wait 5 secs for mysql to be ready for connections
setTimeout(() => {
t.pass('docker started');
t.end(err);
}, 15000);
t.pass('docker started');
t.end(err);
});
});