Update configuration of Travis CI

This commit is contained in:
printempw 2017-11-09 16:22:23 +08:00
parent 488691afa4
commit e5db3a720c
3 changed files with 38 additions and 40 deletions

View File

@ -12,12 +12,12 @@ DB_HOST = 127.0.0.1
DB_PORT = 3306
DB_DATABASE = test
DB_USERNAME = root
DB_PASSWORD = root
DB_PASSWORD = null
DB_PREFIX = null
PWD_METHOD = PHP_PASSWORD_HASH
SALT = 2c5ca184f017a9a1ffbd198ef69b0c0e
APP_KEY = base64:gkb/zouNF6UOSfnr/o+izVMS57WQS3+62YqZBuDyBhU=
SALT = c67709dd8b7b733aca0d570681fe96cf
APP_KEY = base64:eVX/xzF5NhpGB2luswliFx9XSBsbbAP21wOi68X/P34=
MAIL_DRIVER = smtp
MAIL_HOST = null

View File

@ -5,50 +5,39 @@ git:
cache:
directories:
- vendor
- node_modules
- vendor
- node_modules
env:
global: APP_ENV=testing DB_HOST=localhost DB_USERNAME=root DB_PASSWORD= DB_DATABASE=blessing_test
global: APP_ENV=testing
before_install:
- if [[ $TEST_TYPE == 'php' ]]; then mysql -e 'CREATE DATABASE blessing_test;' ; fi
services: mysql
install:
- composer install
install: composer install
before_script:
- if [[ $TEST_TYPE == 'php' ]]; then php artisan key:generate ; fi
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
- php artisan key:random
- php artisan salt:random
script:
- ./vendor/bin/phpunit
script: ./vendor/bin/phpunit
matrix:
include:
- php: 5.6
env: TEST_TYPE=php
services:
- mysql
- php: 7.0
env: TEST_TYPE=php
services:
- mysql
script:
- ./vendor/bin/phpunit --coverage-clover=coverage.xml
after_success:
- bash <(curl -s https://codecov.io/bash) -cF php
- php: 7.1
env: TEST_TYPE=php
services:
- mysql
- node_js: 8
language: node_js
node_js: 8
env: TEST_TYPE=js
install:
- yarn
script:
- yarn run lint
- yarn test:coverage
after_success:
- yarn run codecov
- php: 5.6
- php: 7.0
script:
- ./vendor/bin/phpunit --coverage-clover=coverage.xml
after_success:
- bash <(curl -s https://codecov.io/bash) -cF php
- php: 7.1
- node_js: 8
language: node_js
install: yarn
before_script:
- echo "Testing JavaScript Code" > /dev/null
script:
- yarn run lint
- yarn test:coverage
after_success:
- yarn run codecov

View File

@ -55,6 +55,15 @@ class BootServiceProvider extends ServiceProvider
// check database config
Database::prepareConnection();
} catch (\Exception $e) {
if (PHP_SAPI == "cli") {
// dump some useful information for debugging
dump([
'APP_ENV' => app()->environment(),
'DOTENV_FILE' => app()->environmentFile(),
'DB_CONNECTION' => config('database.connections.mysql')
]);
}
throw new PrettyPageException(
trans('setup.database.connection-error', ['msg' => $e->getMessage()]),
$e->getCode()