mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-01-25 02:08:24 +00:00
changes to handle travis mysql no root pwd
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
const test = require('tape').test ;
|
||||
const exec = require('child_process').exec ;
|
||||
const pwd = process.env.TRAVIS ? '' : '-p$MYSQL_ROOT_PASSWORD';
|
||||
|
||||
test('creating jambones_test database', (t) => {
|
||||
exec(`mysql -h localhost -u root -p$MYSQL_ROOT_PASSWORD < ${__dirname}/../db/create_test_db.sql`, (err, stdout, stderr) => {
|
||||
exec(`mysql -h localhost -u root ${pwd} < ${__dirname}/../db/create_test_db.sql`, (err, stdout, stderr) => {
|
||||
if (err) return t.end(err);
|
||||
t.pass('database successfully created');
|
||||
t.end();
|
||||
@@ -10,7 +11,7 @@ test('creating jambones_test database', (t) => {
|
||||
});
|
||||
|
||||
test('creating schema', (t) => {
|
||||
exec(`mysql -h localhost -u root -p$MYSQL_ROOT_PASSWORD -D jambones_test < ${__dirname}/../db/jambones-sql.sql`, (err, stdout, stderr) => {
|
||||
exec(`mysql -h localhost -u root ${pwd} -D jambones_test < ${__dirname}/../db/jambones-sql.sql`, (err, stdout, stderr) => {
|
||||
if (err) return t.end(err);
|
||||
t.pass('schema successfully created');
|
||||
t.end();
|
||||
@@ -18,7 +19,7 @@ test('creating schema', (t) => {
|
||||
});
|
||||
|
||||
test('creating auth token', (t) => {
|
||||
exec(`mysql -h localhost -u root -p$MYSQL_ROOT_PASSWORD -D jambones_test < ${__dirname}/../db/create-admin-token.sql`, (err, stdout, stderr) => {
|
||||
exec(`mysql -h localhost -u root ${pwd} -D jambones_test < ${__dirname}/../db/create-admin-token.sql`, (err, stdout, stderr) => {
|
||||
if (err) return t.end(err);
|
||||
t.pass('auth token successfully created');
|
||||
t.end();
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
const test = require('tape').test ;
|
||||
const exec = require('child_process').exec ;
|
||||
const pwd = process.env.TRAVIS ? '' : '-p$MYSQL_ROOT_PASSWORD';
|
||||
|
||||
test('dropping jambones_test database', (t) => {
|
||||
exec(`mysql -h localhost -u root -p$MYSQL_ROOT_PASSWORD < ${__dirname}/../db/remove_test_db.sql`, (err, stdout, stderr) => {
|
||||
exec(`mysql -h localhost -u root ${pwd} < ${__dirname}/../db/remove_test_db.sql`, (err, stdout, stderr) => {
|
||||
if (err) return t.end(err);
|
||||
t.pass('database successfully dropped');
|
||||
t.end();
|
||||
|
||||
Reference in New Issue
Block a user