mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-05 15:08:47 +00:00
Add multiple database tests on Travis
This commit is contained in:
parent
5716249455
commit
03fb6fde5f
8 changed files with 273 additions and 27 deletions
25
.travis.yml
25
.travis.yml
|
@ -13,14 +13,22 @@ php:
|
||||||
- 5.4
|
- 5.4
|
||||||
- 5.5
|
- 5.5
|
||||||
- 5.6
|
- 5.6
|
||||||
|
- 7.0
|
||||||
- hhvm
|
- hhvm
|
||||||
- nightly
|
|
||||||
|
env:
|
||||||
|
- DB=mysql
|
||||||
|
- DB=pgsql
|
||||||
|
- DB=sqlite
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
exclude:
|
||||||
|
- php: hhvm
|
||||||
|
env: DB=pgsql # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
|
||||||
|
allow_failures:
|
||||||
|
- php: 7.0
|
||||||
- php: hhvm
|
- php: hhvm
|
||||||
- php: nightly
|
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
@ -29,13 +37,16 @@ branches:
|
||||||
install:
|
install:
|
||||||
- composer self-update
|
- composer self-update
|
||||||
|
|
||||||
# build coverage only on one build, to speed up results feedbacks
|
before_script:
|
||||||
# before_script:
|
# disable xdebug since we don't use code-coverage for now
|
||||||
|
- phpenv config-rm xdebug.ini
|
||||||
|
# build coverage only on one build, to speed up results feedbacks
|
||||||
# - if [[ "$TRAVIS_PHP_VERSION" = "5.6" ]]; then PHPUNIT_FLAGS="--coverage-clover=coverage.clover"; else PHPUNIT_FLAGS=""; fi;
|
# - if [[ "$TRAVIS_PHP_VERSION" = "5.6" ]]; then PHPUNIT_FLAGS="--coverage-clover=coverage.clover"; else PHPUNIT_FLAGS=""; fi;
|
||||||
|
- if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag;' -U postgres; fi;
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ant prepare
|
- ant prepare-$DB
|
||||||
- bin/phpunit --exclude-group command-doctrine --debug $PHPUNIT_FLAGS
|
- bin/phpunit --exclude-group command-doctrine -v
|
||||||
|
|
||||||
# after_script:
|
# after_script:
|
||||||
# - |
|
# - |
|
||||||
|
|
|
@ -19,9 +19,14 @@ swiftmailer:
|
||||||
|
|
||||||
doctrine:
|
doctrine:
|
||||||
dbal:
|
dbal:
|
||||||
driver: pdo_sqlite
|
driver: "%test_database_driver%"
|
||||||
path: %kernel.root_dir%/../data/db/wallabag_test.sqlite
|
host: "%test_database_host%"
|
||||||
host: localhost
|
port: "%test_database_port%"
|
||||||
|
dbname: "%test_database_name%"
|
||||||
|
user: "%test_database_user%"
|
||||||
|
password: "%test_database_password%"
|
||||||
|
charset: UTF8
|
||||||
|
path: "%test_database_path%"
|
||||||
orm:
|
orm:
|
||||||
metadata_cache_driver:
|
metadata_cache_driver:
|
||||||
type: service
|
type: service
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# This file is a "template" of what your parameters.yml file should look like
|
# This file is a "template" of what your parameters.yml file should look like
|
||||||
parameters:
|
parameters:
|
||||||
database_driver: pdo_sqlite
|
database_driver: pdo_sqlite
|
||||||
database_host: 127.0.0.1
|
database_host: 127.0.0.1
|
||||||
database_port: ~
|
database_port: ~
|
||||||
database_name: symfony
|
database_name: symfony
|
||||||
database_user: root
|
database_user: root
|
||||||
|
@ -9,6 +9,14 @@ parameters:
|
||||||
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
database_table_prefix: wallabag_
|
database_table_prefix: wallabag_
|
||||||
|
|
||||||
|
test_database_driver: pdo_sqlite
|
||||||
|
test_database_host: 127.0.0.1
|
||||||
|
test_database_port: ~
|
||||||
|
test_database_name: ~
|
||||||
|
test_database_user: ~
|
||||||
|
test_database_password: ~
|
||||||
|
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
|
||||||
|
|
||||||
mailer_transport: smtp
|
mailer_transport: smtp
|
||||||
mailer_host: 127.0.0.1
|
mailer_host: 127.0.0.1
|
||||||
mailer_user: ~
|
mailer_user: ~
|
||||||
|
|
58
app/config/tests/parameters.yml.dist.mysql
Normal file
58
app/config/tests/parameters.yml.dist.mysql
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
# This file is a "template" of what your parameters.yml file should look like
|
||||||
|
parameters:
|
||||||
|
database_driver: pdo_sqlite
|
||||||
|
database_host: 127.0.0.1
|
||||||
|
database_port: ~
|
||||||
|
database_name: symfony
|
||||||
|
database_user: root
|
||||||
|
database_password: ~
|
||||||
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
|
database_table_prefix: wallabag_
|
||||||
|
|
||||||
|
test_database_driver: pdo_mysql
|
||||||
|
test_database_host: localhost
|
||||||
|
test_database_port: 3306
|
||||||
|
test_database_name: wallabag
|
||||||
|
test_database_user: root
|
||||||
|
test_database_password: ~
|
||||||
|
test_database_path: ~
|
||||||
|
|
||||||
|
mailer_transport: smtp
|
||||||
|
mailer_host: 127.0.0.1
|
||||||
|
mailer_user: ~
|
||||||
|
mailer_password: ~
|
||||||
|
|
||||||
|
locale: en
|
||||||
|
|
||||||
|
# A secret key that's used to generate certain security-related tokens
|
||||||
|
secret: ThisTokenIsNotSoSecretChangeIt
|
||||||
|
|
||||||
|
# wallabag misc
|
||||||
|
app.version: 2.0.0-alpha
|
||||||
|
|
||||||
|
# message to display at the bottom of the page
|
||||||
|
warning_message: >
|
||||||
|
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
|
||||||
|
|
||||||
|
download_pictures: false # if true, pictures will be stored into data/assets for each article
|
||||||
|
|
||||||
|
# Entry view
|
||||||
|
share_twitter: true
|
||||||
|
share_mail: true
|
||||||
|
share_shaarli: true
|
||||||
|
shaarli_url: http://myshaarli.com
|
||||||
|
share_diaspora: true
|
||||||
|
diaspora_url: http://diasporapod.com
|
||||||
|
flattr: true
|
||||||
|
carrot: true
|
||||||
|
show_printlink: true
|
||||||
|
export_epub: true
|
||||||
|
export_mobi: true
|
||||||
|
export_pdf: true
|
||||||
|
|
||||||
|
# default user config
|
||||||
|
items_on_page: 12
|
||||||
|
theme: material
|
||||||
|
language: en_US
|
||||||
|
from_email: no-reply@wallabag.org
|
||||||
|
rss_limit: 50
|
58
app/config/tests/parameters.yml.dist.pgsql
Normal file
58
app/config/tests/parameters.yml.dist.pgsql
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
# This file is a "template" of what your parameters.yml file should look like
|
||||||
|
parameters:
|
||||||
|
database_driver: pdo_sqlite
|
||||||
|
database_host: 127.0.0.1
|
||||||
|
database_port: ~
|
||||||
|
database_name: symfony
|
||||||
|
database_user: root
|
||||||
|
database_password: ~
|
||||||
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
|
database_table_prefix: wallabag_
|
||||||
|
|
||||||
|
test_database_driver: pdo_pgsql
|
||||||
|
test_database_host: localhost
|
||||||
|
test_database_port:
|
||||||
|
test_database_name: wallabag
|
||||||
|
test_database_user: travis
|
||||||
|
test_database_password: ~
|
||||||
|
test_database_path: ~
|
||||||
|
|
||||||
|
mailer_transport: smtp
|
||||||
|
mailer_host: 127.0.0.1
|
||||||
|
mailer_user: ~
|
||||||
|
mailer_password: ~
|
||||||
|
|
||||||
|
locale: en
|
||||||
|
|
||||||
|
# A secret key that's used to generate certain security-related tokens
|
||||||
|
secret: ThisTokenIsNotSoSecretChangeIt
|
||||||
|
|
||||||
|
# wallabag misc
|
||||||
|
app.version: 2.0.0-alpha
|
||||||
|
|
||||||
|
# message to display at the bottom of the page
|
||||||
|
warning_message: >
|
||||||
|
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
|
||||||
|
|
||||||
|
download_pictures: false # if true, pictures will be stored into data/assets for each article
|
||||||
|
|
||||||
|
# Entry view
|
||||||
|
share_twitter: true
|
||||||
|
share_mail: true
|
||||||
|
share_shaarli: true
|
||||||
|
shaarli_url: http://myshaarli.com
|
||||||
|
share_diaspora: true
|
||||||
|
diaspora_url: http://diasporapod.com
|
||||||
|
flattr: true
|
||||||
|
carrot: true
|
||||||
|
show_printlink: true
|
||||||
|
export_epub: true
|
||||||
|
export_mobi: true
|
||||||
|
export_pdf: true
|
||||||
|
|
||||||
|
# default user config
|
||||||
|
items_on_page: 12
|
||||||
|
theme: material
|
||||||
|
language: en_US
|
||||||
|
from_email: no-reply@wallabag.org
|
||||||
|
rss_limit: 50
|
58
app/config/tests/parameters.yml.dist.sqlite
Normal file
58
app/config/tests/parameters.yml.dist.sqlite
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
# This file is a "template" of what your parameters.yml file should look like
|
||||||
|
parameters:
|
||||||
|
database_driver: pdo_sqlite
|
||||||
|
database_host: 127.0.0.1
|
||||||
|
database_port: ~
|
||||||
|
database_name: symfony
|
||||||
|
database_user: root
|
||||||
|
database_password: ~
|
||||||
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
|
database_table_prefix: wallabag_
|
||||||
|
|
||||||
|
test_database_driver: pdo_sqlite
|
||||||
|
test_database_host: localhost
|
||||||
|
test_database_port:
|
||||||
|
test_database_name: ~
|
||||||
|
test_database_user: ~
|
||||||
|
test_database_password: ~
|
||||||
|
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
|
||||||
|
|
||||||
|
mailer_transport: smtp
|
||||||
|
mailer_host: 127.0.0.1
|
||||||
|
mailer_user: ~
|
||||||
|
mailer_password: ~
|
||||||
|
|
||||||
|
locale: en
|
||||||
|
|
||||||
|
# A secret key that's used to generate certain security-related tokens
|
||||||
|
secret: ThisTokenIsNotSoSecretChangeIt
|
||||||
|
|
||||||
|
# wallabag misc
|
||||||
|
app.version: 2.0.0-alpha
|
||||||
|
|
||||||
|
# message to display at the bottom of the page
|
||||||
|
warning_message: >
|
||||||
|
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
|
||||||
|
|
||||||
|
download_pictures: false # if true, pictures will be stored into data/assets for each article
|
||||||
|
|
||||||
|
# Entry view
|
||||||
|
share_twitter: true
|
||||||
|
share_mail: true
|
||||||
|
share_shaarli: true
|
||||||
|
shaarli_url: http://myshaarli.com
|
||||||
|
share_diaspora: true
|
||||||
|
diaspora_url: http://diasporapod.com
|
||||||
|
flattr: true
|
||||||
|
carrot: true
|
||||||
|
show_printlink: true
|
||||||
|
export_epub: true
|
||||||
|
export_mobi: true
|
||||||
|
export_pdf: true
|
||||||
|
|
||||||
|
# default user config
|
||||||
|
items_on_page: 12
|
||||||
|
theme: material
|
||||||
|
language: en_US
|
||||||
|
from_email: no-reply@wallabag.org
|
||||||
|
rss_limit: 50
|
52
build.xml
52
build.xml
|
@ -1,17 +1,23 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="wallabag" default="build">
|
<project name="wallabag" default="build">
|
||||||
<target name="build" depends="prepare"/>
|
<target name="build" depends="clean,composer,prepare,phpunit"/>
|
||||||
|
<target name="prepare-mysql" depends="clean,composer,db_mysql,prepare"/>
|
||||||
|
<target name="prepare-sqlite" depends="clean,composer,db_sqlite,prepare"/>
|
||||||
|
<target name="prepare-pgsql" depends="clean,composer,db_pgsql,prepare"/>
|
||||||
|
|
||||||
<target name="clean" description="Cleanup build artifacts">
|
<target name="clean" description="Cleanup build artifacts">
|
||||||
<delete dir="${basedir}/app/cache"/>
|
<delete dir="${basedir}/app/cache"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="prepare" depends="clean" description="Prepare for build">
|
<target name="composer" description="Install deps using Composer">
|
||||||
<exec executable="composer">
|
<exec executable="composer">
|
||||||
<arg value="install"/>
|
<arg value="install"/>
|
||||||
<arg value="--no-interaction"/>
|
<arg value="--no-interaction"/>
|
||||||
<arg value="--no-progress"/>
|
<arg value="--no-progress"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="prepare" description="Prepare for build">
|
||||||
<exec executable="php">
|
<exec executable="php">
|
||||||
<arg value="${basedir}/app/console"/>
|
<arg value="${basedir}/app/console"/>
|
||||||
<arg value="doctrine:database:drop"/>
|
<arg value="doctrine:database:drop"/>
|
||||||
|
@ -41,6 +47,48 @@
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="db_mysql" description="Run test for MySQL">
|
||||||
|
<delete dir="${basedir}/app/config/parameters.yml"/>
|
||||||
|
<exec executable="cp">
|
||||||
|
<arg value="${basedir}/app/config/tests/parameters.yml.dist.mysql"/>
|
||||||
|
<arg value="${basedir}/app/config/parameters.yml"/>
|
||||||
|
</exec>
|
||||||
|
|
||||||
|
<exec executable="php">
|
||||||
|
<arg value="${basedir}/app/console"/>
|
||||||
|
<arg value="cache:clear"/>
|
||||||
|
<arg value="--env=test"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="db_sqlite" description="Run test for SQLite">
|
||||||
|
<delete dir="${basedir}/app/config/parameters.yml"/>
|
||||||
|
<exec executable="cp">
|
||||||
|
<arg value="${basedir}/app/config/tests/parameters.yml.dist.sqlite"/>
|
||||||
|
<arg value="${basedir}/app/config/parameters.yml"/>
|
||||||
|
</exec>
|
||||||
|
|
||||||
|
<exec executable="php">
|
||||||
|
<arg value="${basedir}/app/console"/>
|
||||||
|
<arg value="cache:clear"/>
|
||||||
|
<arg value="--env=test"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="db_pgsql" description="Run test for PostgreSQL">
|
||||||
|
<delete dir="${basedir}/app/config/parameters.yml"/>
|
||||||
|
<exec executable="cp">
|
||||||
|
<arg value="${basedir}/app/config/tests/parameters.yml.dist.pgsql"/>
|
||||||
|
<arg value="${basedir}/app/config/parameters.yml"/>
|
||||||
|
</exec>
|
||||||
|
|
||||||
|
<exec executable="php">
|
||||||
|
<arg value="${basedir}/app/console"/>
|
||||||
|
<arg value="cache:clear"/>
|
||||||
|
<arg value="--env=test"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
|
<target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
|
||||||
<exec executable="phpunit" failonerror="true">
|
<exec executable="phpunit" failonerror="true">
|
||||||
<arg value="--coverage-html"/>
|
<arg value="--coverage-html"/>
|
||||||
|
|
26
composer.lock
generated
26
composer.lock
generated
|
@ -1355,16 +1355,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "j0k3r/php-readability",
|
"name": "j0k3r/php-readability",
|
||||||
"version": "v1.0.7",
|
"version": "v1.0.8",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/j0k3r/php-readability.git",
|
"url": "https://github.com/j0k3r/php-readability.git",
|
||||||
"reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4"
|
"reference": "f71c3a419623f821c245e0a003edfbf2c67f278e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/j0k3r/php-readability/zipball/1830dc45d4fccfe09d2d107ab59890f07adc35c4",
|
"url": "https://api.github.com/repos/j0k3r/php-readability/zipball/f71c3a419623f821c245e0a003edfbf2c67f278e",
|
||||||
"reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4",
|
"reference": "f71c3a419623f821c245e0a003edfbf2c67f278e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1414,7 +1414,7 @@
|
||||||
"extraction",
|
"extraction",
|
||||||
"html"
|
"html"
|
||||||
],
|
],
|
||||||
"time": "2015-09-20 19:05:55"
|
"time": "2015-09-23 19:09:38"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "jdorn/sql-formatter",
|
"name": "jdorn/sql-formatter",
|
||||||
|
@ -2970,20 +2970,20 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/symfony",
|
"name": "symfony/symfony",
|
||||||
"version": "v2.7.4",
|
"version": "v2.7.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/symfony.git",
|
"url": "https://github.com/symfony/symfony.git",
|
||||||
"reference": "1fdf23fe28876844b887b0e1935c9adda43ee645"
|
"reference": "619528a274647cffc1792063c3ea04c4fa8266a0"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/symfony/zipball/1fdf23fe28876844b887b0e1935c9adda43ee645",
|
"url": "https://api.github.com/repos/symfony/symfony/zipball/619528a274647cffc1792063c3ea04c4fa8266a0",
|
||||||
"reference": "1fdf23fe28876844b887b0e1935c9adda43ee645",
|
"reference": "619528a274647cffc1792063c3ea04c4fa8266a0",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"doctrine/common": "~2.3",
|
"doctrine/common": "~2.4",
|
||||||
"php": ">=5.3.9",
|
"php": ">=5.3.9",
|
||||||
"psr/log": "~1.0",
|
"psr/log": "~1.0",
|
||||||
"twig/twig": "~1.20|~2.0"
|
"twig/twig": "~1.20|~2.0"
|
||||||
|
@ -3036,9 +3036,9 @@
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/data-fixtures": "1.0.*",
|
"doctrine/data-fixtures": "1.0.*",
|
||||||
"doctrine/dbal": "~2.2",
|
"doctrine/dbal": "~2.4",
|
||||||
"doctrine/doctrine-bundle": "~1.2",
|
"doctrine/doctrine-bundle": "~1.2",
|
||||||
"doctrine/orm": "~2.2,>=2.2.3",
|
"doctrine/orm": "~2.4,>=2.4.5",
|
||||||
"egulias/email-validator": "~1.2",
|
"egulias/email-validator": "~1.2",
|
||||||
"ircmaxell/password-compat": "~1.0",
|
"ircmaxell/password-compat": "~1.0",
|
||||||
"monolog/monolog": "~1.11",
|
"monolog/monolog": "~1.11",
|
||||||
|
@ -3088,7 +3088,7 @@
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"framework"
|
"framework"
|
||||||
],
|
],
|
||||||
"time": "2015-09-08 14:26:39"
|
"time": "2015-09-25 11:16:52"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tecnick.com/tcpdf",
|
"name": "tecnick.com/tcpdf",
|
||||||
|
|
Loading…
Reference in a new issue