Skip to content

Commit

Permalink
DevKit updates (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlastCI authored and FanchTheSystem committed May 18, 2017
1 parent eb32a8d commit ed6dfcb
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/composer.lock
/vendor/
/Resources/doc/_build
/bin/phpunit
/bin/phpunit
*~
18 changes: 2 additions & 16 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
# Package `sllh/php-cs-fixer-styleci-bridge` is required to get it working.

preset: symfony
preset: psr2

enabled:
# - class_keyword_remove
- combine_consecutive_unsets
# - long_array_syntax
- newline_after_open_tag
- no_php4_constructor
- no_useless_else
# - ordered_class_elements
# - ordered_use
# Comment strict rules for the moment. Should be uncomment later to see StyleCI PR results
# - strict
# - strict_param
# - php_unit_construct
# - php_unit_strict
- strict

finder:
exclude:
- 'Tests/Fixtures'
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ php:
- '7.1'
- nightly

services:
- mysql
- postgresql

sudo: false

cache:
Expand Down Expand Up @@ -41,7 +45,8 @@ before_install:
- if [[ -x ${SCRIPTS_FOLDER}/check_relevant_${TARGET}.sh && "$TRAVIS_PULL_REQUEST" != "false" ]]; then export RELEVANT=$(${SCRIPTS_FOLDER}/check_relevant_${TARGET}.sh); fi;
- if [[ ! -z ${RELEVANT} ]];then exit 0; fi;
- if [ -x ${SCRIPTS_FOLDER}/before_install_${TARGET}.sh ]; then ${SCRIPTS_FOLDER}/before_install_${TARGET}.sh; fi;

- if [ -x ${SCRIPTS_FOLDER}/create_travis_database_${TARGET}.sh ]; then ${SCRIPTS_FOLDER}/create_travis_database_${TARGET}.sh; fi;

install:
- if [ -x ${SCRIPTS_FOLDER}/install_${TARGET}.sh ]; then ${SCRIPTS_FOLDER}/install_${TARGET}.sh; fi;

Expand Down
35 changes: 35 additions & 0 deletions bin/ci-scripts/create_travis_database_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env sh
set -ev

# Database creation

###
### mysql
###

# (mysql service is started by default by travis for each build instance
# (mysql travis user is created by travis for each build instance
mysql -u travis -e 'CREATE DATABASE travis;' -v

###
### postgresql
###

# needed in .travis.yml
#services:
# - postgresql
# or here : sudo /etc/init.d/postgresql start

# (we try to create a travis user)
# psql -c 'CREATE USER travis;' -U postgres
# psql -c 'ALTER ROLE travis WITH CREATEDB;' -U postgres

psql -c 'CREATE DATABASE travis;' -U postgres
psql -c 'ALTER DATABASE travis OWNER TO travis' -U postgres


#psql -U postgres -c "CREATE EXTENSION 'uuid-ossp';"

###
###
###
12 changes: 8 additions & 4 deletions bin/ci-scripts/install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ set -ev
mkdir --parents "${HOME}/bin"

# PHPUnit install
if [ ${TRAVIS_PHP_VERSION} '<' '5.6' ]; then
PHPUNIT_PHAR=phpunit-4.8.phar
else
# strange sh operator '<' ...
if [ ${TRAVIS_PHP_VERSION} '<' '7.0' ]; then
PHPUNIT_PHAR=phpunit-5.7.phar
else
PHPUNIT_PHAR=phpunit.phar
fi
wget "https://phar.phpunit.de/${PHPUNIT_PHAR}" --output-document="${HOME}/bin/phpunit"
chmod u+x "${HOME}/bin/phpunit"
Expand All @@ -16,8 +17,11 @@ chmod u+x "${HOME}/bin/phpunit"
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar --output-document="${HOME}/bin/coveralls"
chmod u+x "${HOME}/bin/coveralls"

# Ugly hack
echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
if [ "${COMPOSER_FLAGS}" = '--prefer-lowest' ]; then
composer update --prefer-dist --no-interaction --prefer-stable --quiet
fi
composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS}
composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS}
26 changes: 14 additions & 12 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,37 @@
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/Resources/bootstrap.php"
>
>


<testsuites>
<testsuite name="Unit">
<directory>./tests/Unit</directory>
</testsuite>
<testsuite name="Functional">
<directory>./tests/Functional</directory>
</testsuite>
<testsuites>
<testsuite name="Unit">
<directory>./tests/Unit</directory>
</testsuite>
<testsuite name="Functional">
<directory>./tests/Functional</directory>
</testsuite>
</testsuites>


<filter>
<whitelist>
<directory>./src</directory>
<exclude>
<directory>./Tests/</directory>
<directory>./tests/</directory>
<directory>./DataFixtures/</directory>
<directory>./Resources/</directory>
<directory>./src/Resources/</directory>
<directory>./vendor/</directory>
<directory>./coverage/</directory>
</exclude>
</whitelist>
</filter>

<php>
<server name="KERNEL_DIR" value="tests/Resources/app/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="KERNEL_DIR" value="tests/Resources/App/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<ini name="display_errors" value="On" />
<ini name="display_startup_errors" value="On" />
</php>

</phpunit>
16 changes: 16 additions & 0 deletions tests/Resources/App/config/config_test_mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
imports:
- { resource: config.yml }

# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: 127.0.0.1
port: null
dbname: travis
user: travis
password: ~
charset: UTF8
orm:
auto_mapping: true

15 changes: 15 additions & 0 deletions tests/Resources/App/config/config_test_postgresql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
imports:
- { resource: config.yml }

# Doctrine Configuration
doctrine:
dbal:
driver: pdo_pgsql
host: 127.0.0.1
port: 5432
dbname: travis
user: travis
password: ~
charset: UTF8
orm:
auto_mapping: true

0 comments on commit ed6dfcb

Please sign in to comment.