From 6df8b9c6a90de333c9e24a49615fffa9e350e382 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 5 Dec 2018 14:29:46 +0100 Subject: [PATCH] Fix PG & Travis drop/create database --- .editorconfig | 2 +- .travis.yml | 10 ++++++---- GNUmakefile | 6 ++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6553d30f..14044044 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,5 +13,5 @@ insert_final_newline = true indent_style = space indent_size = 2 -[Makefile] +[*akefile] indent_style = tab diff --git a/.travis.yml b/.travis.yml index 0ca1e192..c660bb5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,15 +51,17 @@ install: before_script: - PHP=$TRAVIS_PHP_VERSION - - if [[ ! $PHP = hhvm* ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi; - # xdebug isn't enable for PHP 7.1 - - if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi + - echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini + - phpenv config-rm xdebug.ini || echo "xdebug not available" - composer self-update --no-progress script: - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist + - echo "travis_fold:start:prepare" - - make prepare DB=$DB + # custom "prepare" for PG because the database should be created with a different user (see "before_script") + - if [[ ! $DB = pgsql ]]; then make prepare DB=$DB; fi; + - if [[ $DB = pgsql ]]; then make prepare-travis-pg DB=$DB; fi; - echo "travis_fold:end:prepare" - make fixtures diff --git a/GNUmakefile b/GNUmakefile index a04468cb..d8c16202 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -25,6 +25,12 @@ run: ## Run the wallabag built-in server build: ## Run webpack @npm run build:$(ENV) +prepare-travis-pg: ## Custom prepare for Travis & Postgres (do not drop/create the database) +ifdef DB + cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml +endif + php bin/console doctrine:migrations:migrate --no-interaction --env=test + prepare: clean ## Prepare database for testsuite ifdef DB cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml -- 2.41.0