fix(tests): repair travis-ci mysql testing to ensure auth-db-mysql is used
This commit is contained in:
Родитель
0bab602469
Коммит
6eb363952b
|
@ -30,9 +30,10 @@ notifications:
|
|||
skip_join: false
|
||||
|
||||
before_install:
|
||||
- npm install -g npm@2
|
||||
- npm config set spin false
|
||||
|
||||
script:
|
||||
- if [ $DB == "mysql" ]; then echo '~*~ Starting auth-db-mysql'; (./scripts/start-local-test-mysql.sh &>/dev/null &); fi
|
||||
- if [ $DB == "mysql" ]; then ./scripts/start-travis-auth-db-mysql.sh; fi
|
||||
- npm test
|
||||
- grunt nsp --force
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
node ./scripts/gen_keys.js
|
||||
|
||||
ls ./node_modules/fxa-auth-db-mysql/node_modules/mysql-patcher || npm i ./node_modules/fxa-auth-db-mysql
|
||||
node ./node_modules/fxa-auth-db-mysql/bin/db_patcher.js
|
||||
node ./node_modules/fxa-auth-db-mysql/bin/server.js
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ev
|
||||
|
||||
node ./scripts/gen_keys.js
|
||||
|
||||
# Force install of mysql-patcher
|
||||
(cd node_modules/fxa-auth-db-mysql && npm install &>/var/tmp/db-mysql.out)
|
||||
|
||||
mysql -e 'DROP DATABASE IF EXISTS fxa'
|
||||
node ./node_modules/fxa-auth-db-mysql/bin/db_patcher.js
|
||||
|
||||
# Start backgrounded fxa-auth-db-mysql server
|
||||
nohup node ./node_modules/fxa-auth-db-mysql/bin/server.js &>>/var/tmp/db-mysql.out &
|
||||
|
||||
# Give auth-db-mysql a moment to start up
|
||||
sleep 5
|
||||
|
||||
# This curl will cause a test fail if no connection
|
||||
# TODO: in the future, check that response contains "implementation: 'MySql'"
|
||||
curl http://127.0.0.1:8000/; echo
|
Загрузка…
Ссылка в новой задаче