mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2025-12-19 04:27:45 +00:00
ci: healthcheck for mysqldb
This commit is contained in:
6
.github/workflows/npm-publish.yml
vendored
6
.github/workflows/npm-publish.yml
vendored
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user