From 01569aa4ffc99121a49a9c44f5e1105fc1a6de43 Mon Sep 17 00:00:00 2001 From: Robbie Mackay Date: Fri, 31 Mar 2017 16:19:31 +1300 Subject: [PATCH] Try to fix travis tests --- .env.travis | 5 +++++ .travis.yml | 13 +++++++++---- composer.json | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .env.travis diff --git a/.env.travis b/.env.travis new file mode 100644 index 0000000000..ee2f7476ba --- /dev/null +++ b/.env.travis @@ -0,0 +1,5 @@ +DB_TYPE=MySQLi +DB_HOST=127.0.0.1 +DB_NAME=ushahidi +DB_PASS= +DB_USER=travis diff --git a/.travis.yml b/.travis.yml index 00b520b42e..e6596716df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,30 +4,35 @@ sudo: false # secure: NxhzhKGYnZYZiWVZM4w1PlZpTy9bbmNlvbqjL+9d4PvK4hFzPwQU12CchhBPeXNGLWBHg/ti6Scn/t5XIS3YJrkk4ydWmJBht5UId8uFZ1A7GCUnNNPTt2RG55lbJJdZSj01rOGZjEQbE5RyckEjgRzhZjdZ+HsjoPaRzWIBrvE= language: php php: -- '5.5' - '5.6' +- '7.0' env: - coverage="--coverage" - coverage="" matrix: exclude: - - php: '5.5' + - php: '7.0' env: coverage="--coverage" allow_failures: - env: coverage="--coverage" + - php: '7.0' fast_finish: true cache: directories: - "$HOME/.composer/cache" services: - mysql +before_install: +- mysql -e 'CREATE DATABASE ushahidi;' +- cp .env.travis .env install: - composer install --no-interaction before_script: -- "./bin/tests install" +- composer pre-test - mysql -e 'SET @@GLOBAL.wait_timeout=1800' script: -- "./bin/tests run --no-install $coverage" +- if [ "${coverage}" == "" ]; then composer test; fi +- if [ "${coverage}" != "" ]; then composer coverage; fi - composer lint after_success: - if [ "${coverage}" != "" ]; then travis_retry bin/coveralls -v; fi diff --git a/composer.json b/composer.json index abae1373ac..278e11ffb5 100644 --- a/composer.json +++ b/composer.json @@ -95,6 +95,7 @@ "behat --strict --profile ci" ], "pre-test" : [ + "bin/phinx migrate -c application/phinx.php", "php -S localhost:8000 -t httpdocs httpdocs/index.php &" ], "test" : [