aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-09-26 11:56:15 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-09-26 11:56:15 +0200
commit03fb6fde5f02c4fce49fbe20ed384e693b805a0a (patch)
tree45d7144beaf305b182ca55a8d50178a492941636
parent57162494557c5eac938a7d6800ac1b112f73efc9 (diff)
downloadwallabag-03fb6fde5f02c4fce49fbe20ed384e693b805a0a.tar.gz
wallabag-03fb6fde5f02c4fce49fbe20ed384e693b805a0a.tar.zst
wallabag-03fb6fde5f02c4fce49fbe20ed384e693b805a0a.zip
Add multiple database tests on Travis
-rw-r--r--.travis.yml23
-rw-r--r--app/config/config_test.yml11
-rw-r--r--app/config/parameters.yml.dist12
-rw-r--r--app/config/tests/parameters.yml.dist.mysql58
-rw-r--r--app/config/tests/parameters.yml.dist.pgsql58
-rw-r--r--app/config/tests/parameters.yml.dist.sqlite58
-rw-r--r--build.xml52
-rw-r--r--composer.lock26
8 files changed, 272 insertions, 26 deletions
diff --git a/.travis.yml b/.travis.yml
index 8d0cf817..f78c2b15 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,14 +13,22 @@ php:
13 - 5.4 13 - 5.4
14 - 5.5 14 - 5.5
15 - 5.6 15 - 5.6
16 - 7.0
16 - hhvm 17 - hhvm
17 - nightly 18
19env:
20 - DB=mysql
21 - DB=pgsql
22 - DB=sqlite
18 23
19matrix: 24matrix:
20 fast_finish: true 25 fast_finish: true
26 exclude:
27 - php: hhvm
28 env: DB=pgsql # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
21 allow_failures: 29 allow_failures:
30 - php: 7.0
22 - php: hhvm 31 - php: hhvm
23 - php: nightly
24 32
25branches: 33branches:
26 only: 34 only:
@@ -29,13 +37,16 @@ branches:
29install: 37install:
30 - composer self-update 38 - composer self-update
31 39
32# build coverage only on one build, to speed up results feedbacks 40before_script:
33# before_script: 41 # disable xdebug since we don't use code-coverage for now
42 - phpenv config-rm xdebug.ini
43 # build coverage only on one build, to speed up results feedbacks
34 # - if [[ "$TRAVIS_PHP_VERSION" = "5.6" ]]; then PHPUNIT_FLAGS="--coverage-clover=coverage.clover"; else PHPUNIT_FLAGS=""; fi; 44 # - if [[ "$TRAVIS_PHP_VERSION" = "5.6" ]]; then PHPUNIT_FLAGS="--coverage-clover=coverage.clover"; else PHPUNIT_FLAGS=""; fi;
45 - if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag;' -U postgres; fi;
35 46
36script: 47script:
37 - ant prepare 48 - ant prepare-$DB
38 - bin/phpunit --exclude-group command-doctrine --debug $PHPUNIT_FLAGS 49 - bin/phpunit --exclude-group command-doctrine -v
39 50
40# after_script: 51# after_script:
41 # - | 52 # - |
diff --git a/app/config/config_test.yml b/app/config/config_test.yml
index 4dca39d2..2fd489be 100644
--- a/app/config/config_test.yml
+++ b/app/config/config_test.yml
@@ -19,9 +19,14 @@ swiftmailer:
19 19
20doctrine: 20doctrine:
21 dbal: 21 dbal:
22 driver: pdo_sqlite 22 driver: "%test_database_driver%"
23 path: %kernel.root_dir%/../data/db/wallabag_test.sqlite 23 host: "%test_database_host%"
24 host: localhost 24 port: "%test_database_port%"
25 dbname: "%test_database_name%"
26 user: "%test_database_user%"
27 password: "%test_database_password%"
28 charset: UTF8
29 path: "%test_database_path%"
25 orm: 30 orm:
26 metadata_cache_driver: 31 metadata_cache_driver:
27 type: service 32 type: service
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist
index b3947207..c1f6bc1b 100644
--- a/app/config/parameters.yml.dist
+++ b/app/config/parameters.yml.dist
@@ -1,7 +1,7 @@
1# This file is a "template" of what your parameters.yml file should look like 1# This file is a "template" of what your parameters.yml file should look like
2parameters: 2parameters:
3 database_driver: pdo_sqlite 3 database_driver: pdo_sqlite
4 database_host: 127.0.0.1 4 database_host: 127.0.0.1
5 database_port: ~ 5 database_port: ~
6 database_name: symfony 6 database_name: symfony
7 database_user: root 7 database_user: root
@@ -9,6 +9,14 @@ parameters:
9 database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" 9 database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
10 database_table_prefix: wallabag_ 10 database_table_prefix: wallabag_
11 11
12 test_database_driver: pdo_sqlite
13 test_database_host: 127.0.0.1
14 test_database_port: ~
15 test_database_name: ~
16 test_database_user: ~
17 test_database_password: ~
18 test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
19
12 mailer_transport: smtp 20 mailer_transport: smtp
13 mailer_host: 127.0.0.1 21 mailer_host: 127.0.0.1
14 mailer_user: ~ 22 mailer_user: ~
diff --git a/app/config/tests/parameters.yml.dist.mysql b/app/config/tests/parameters.yml.dist.mysql
new file mode 100644
index 00000000..d8c23634
--- /dev/null
+++ b/app/config/tests/parameters.yml.dist.mysql
@@ -0,0 +1,58 @@
1# This file is a "template" of what your parameters.yml file should look like
2parameters:
3 database_driver: pdo_sqlite
4 database_host: 127.0.0.1
5 database_port: ~
6 database_name: symfony
7 database_user: root
8 database_password: ~
9 database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
10 database_table_prefix: wallabag_
11
12 test_database_driver: pdo_mysql
13 test_database_host: localhost
14 test_database_port: 3306
15 test_database_name: wallabag
16 test_database_user: root
17 test_database_password: ~
18 test_database_path: ~
19
20 mailer_transport: smtp
21 mailer_host: 127.0.0.1
22 mailer_user: ~
23 mailer_password: ~
24
25 locale: en
26
27 # A secret key that's used to generate certain security-related tokens
28 secret: ThisTokenIsNotSoSecretChangeIt
29
30 # wallabag misc
31 app.version: 2.0.0-alpha
32
33 # message to display at the bottom of the page
34 warning_message: >
35 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>
36
37 download_pictures: false # if true, pictures will be stored into data/assets for each article
38
39 # Entry view
40 share_twitter: true
41 share_mail: true
42 share_shaarli: true
43 shaarli_url: http://myshaarli.com
44 share_diaspora: true
45 diaspora_url: http://diasporapod.com
46 flattr: true
47 carrot: true
48 show_printlink: true
49 export_epub: true
50 export_mobi: true
51 export_pdf: true
52
53 # default user config
54 items_on_page: 12
55 theme: material
56 language: en_US
57 from_email: no-reply@wallabag.org
58 rss_limit: 50
diff --git a/app/config/tests/parameters.yml.dist.pgsql b/app/config/tests/parameters.yml.dist.pgsql
new file mode 100644
index 00000000..7dc63880
--- /dev/null
+++ b/app/config/tests/parameters.yml.dist.pgsql
@@ -0,0 +1,58 @@
1# This file is a "template" of what your parameters.yml file should look like
2parameters:
3 database_driver: pdo_sqlite
4 database_host: 127.0.0.1
5 database_port: ~
6 database_name: symfony
7 database_user: root
8 database_password: ~
9 database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
10 database_table_prefix: wallabag_
11
12 test_database_driver: pdo_pgsql
13 test_database_host: localhost
14 test_database_port:
15 test_database_name: wallabag
16 test_database_user: travis
17 test_database_password: ~
18 test_database_path: ~
19
20 mailer_transport: smtp
21 mailer_host: 127.0.0.1
22 mailer_user: ~
23 mailer_password: ~
24
25 locale: en
26
27 # A secret key that's used to generate certain security-related tokens
28 secret: ThisTokenIsNotSoSecretChangeIt
29
30 # wallabag misc
31 app.version: 2.0.0-alpha
32
33 # message to display at the bottom of the page
34 warning_message: >
35 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>
36
37 download_pictures: false # if true, pictures will be stored into data/assets for each article
38
39 # Entry view
40 share_twitter: true
41 share_mail: true
42 share_shaarli: true
43 shaarli_url: http://myshaarli.com
44 share_diaspora: true
45 diaspora_url: http://diasporapod.com
46 flattr: true
47 carrot: true
48 show_printlink: true
49 export_epub: true
50 export_mobi: true
51 export_pdf: true
52
53 # default user config
54 items_on_page: 12
55 theme: material
56 language: en_US
57 from_email: no-reply@wallabag.org
58 rss_limit: 50
diff --git a/app/config/tests/parameters.yml.dist.sqlite b/app/config/tests/parameters.yml.dist.sqlite
new file mode 100644
index 00000000..3ef7cda4
--- /dev/null
+++ b/app/config/tests/parameters.yml.dist.sqlite
@@ -0,0 +1,58 @@
1# This file is a "template" of what your parameters.yml file should look like
2parameters:
3 database_driver: pdo_sqlite
4 database_host: 127.0.0.1
5 database_port: ~
6 database_name: symfony
7 database_user: root
8 database_password: ~
9 database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
10 database_table_prefix: wallabag_
11
12 test_database_driver: pdo_sqlite
13 test_database_host: localhost
14 test_database_port:
15 test_database_name: ~
16 test_database_user: ~
17 test_database_password: ~
18 test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
19
20 mailer_transport: smtp
21 mailer_host: 127.0.0.1
22 mailer_user: ~
23 mailer_password: ~
24
25 locale: en
26
27 # A secret key that's used to generate certain security-related tokens
28 secret: ThisTokenIsNotSoSecretChangeIt
29
30 # wallabag misc
31 app.version: 2.0.0-alpha
32
33 # message to display at the bottom of the page
34 warning_message: >
35 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>
36
37 download_pictures: false # if true, pictures will be stored into data/assets for each article
38
39 # Entry view
40 share_twitter: true
41 share_mail: true
42 share_shaarli: true
43 shaarli_url: http://myshaarli.com
44 share_diaspora: true
45 diaspora_url: http://diasporapod.com
46 flattr: true
47 carrot: true
48 show_printlink: true
49 export_epub: true
50 export_mobi: true
51 export_pdf: true
52
53 # default user config
54 items_on_page: 12
55 theme: material
56 language: en_US
57 from_email: no-reply@wallabag.org
58 rss_limit: 50
diff --git a/build.xml b/build.xml
index 30ed2fa1..110011e8 100644
--- a/build.xml
+++ b/build.xml
@@ -1,17 +1,23 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<project name="wallabag" default="build"> 2<project name="wallabag" default="build">
3 <target name="build" depends="prepare"/> 3 <target name="build" depends="clean,composer,prepare,phpunit"/>
4 <target name="prepare-mysql" depends="clean,composer,db_mysql,prepare"/>
5 <target name="prepare-sqlite" depends="clean,composer,db_sqlite,prepare"/>
6 <target name="prepare-pgsql" depends="clean,composer,db_pgsql,prepare"/>
4 7
5 <target name="clean" description="Cleanup build artifacts"> 8 <target name="clean" description="Cleanup build artifacts">
6 <delete dir="${basedir}/app/cache"/> 9 <delete dir="${basedir}/app/cache"/>
7 </target> 10 </target>
8 11
9 <target name="prepare" depends="clean" description="Prepare for build"> 12 <target name="composer" description="Install deps using Composer">
10 <exec executable="composer"> 13 <exec executable="composer">
11 <arg value="install"/> 14 <arg value="install"/>
12 <arg value="--no-interaction"/> 15 <arg value="--no-interaction"/>
13 <arg value="--no-progress"/> 16 <arg value="--no-progress"/>
14 </exec> 17 </exec>
18 </target>
19
20 <target name="prepare" description="Prepare for build">
15 <exec executable="php"> 21 <exec executable="php">
16 <arg value="${basedir}/app/console"/> 22 <arg value="${basedir}/app/console"/>
17 <arg value="doctrine:database:drop"/> 23 <arg value="doctrine:database:drop"/>
@@ -41,6 +47,48 @@
41 </exec> 47 </exec>
42 </target> 48 </target>
43 49
50 <target name="db_mysql" description="Run test for MySQL">
51 <delete dir="${basedir}/app/config/parameters.yml"/>
52 <exec executable="cp">
53 <arg value="${basedir}/app/config/tests/parameters.yml.dist.mysql"/>
54 <arg value="${basedir}/app/config/parameters.yml"/>
55 </exec>
56
57 <exec executable="php">
58 <arg value="${basedir}/app/console"/>
59 <arg value="cache:clear"/>
60 <arg value="--env=test"/>
61 </exec>
62 </target>
63
64 <target name="db_sqlite" description="Run test for SQLite">
65 <delete dir="${basedir}/app/config/parameters.yml"/>
66 <exec executable="cp">
67 <arg value="${basedir}/app/config/tests/parameters.yml.dist.sqlite"/>
68 <arg value="${basedir}/app/config/parameters.yml"/>
69 </exec>
70
71 <exec executable="php">
72 <arg value="${basedir}/app/console"/>
73 <arg value="cache:clear"/>
74 <arg value="--env=test"/>
75 </exec>
76 </target>
77
78 <target name="db_pgsql" description="Run test for PostgreSQL">
79 <delete dir="${basedir}/app/config/parameters.yml"/>
80 <exec executable="cp">
81 <arg value="${basedir}/app/config/tests/parameters.yml.dist.pgsql"/>
82 <arg value="${basedir}/app/config/parameters.yml"/>
83 </exec>
84
85 <exec executable="php">
86 <arg value="${basedir}/app/console"/>
87 <arg value="cache:clear"/>
88 <arg value="--env=test"/>
89 </exec>
90 </target>
91
44 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage"> 92 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
45 <exec executable="phpunit" failonerror="true"> 93 <exec executable="phpunit" failonerror="true">
46 <arg value="--coverage-html"/> 94 <arg value="--coverage-html"/>
diff --git a/composer.lock b/composer.lock
index ef060b5e..67b2c714 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1355,16 +1355,16 @@
1355 }, 1355 },
1356 { 1356 {
1357 "name": "j0k3r/php-readability", 1357 "name": "j0k3r/php-readability",
1358 "version": "v1.0.7", 1358 "version": "v1.0.8",
1359 "source": { 1359 "source": {
1360 "type": "git", 1360 "type": "git",
1361 "url": "https://github.com/j0k3r/php-readability.git", 1361 "url": "https://github.com/j0k3r/php-readability.git",
1362 "reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4" 1362 "reference": "f71c3a419623f821c245e0a003edfbf2c67f278e"
1363 }, 1363 },
1364 "dist": { 1364 "dist": {
1365 "type": "zip", 1365 "type": "zip",
1366 "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/1830dc45d4fccfe09d2d107ab59890f07adc35c4", 1366 "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/f71c3a419623f821c245e0a003edfbf2c67f278e",
1367 "reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4", 1367 "reference": "f71c3a419623f821c245e0a003edfbf2c67f278e",
1368 "shasum": "" 1368 "shasum": ""
1369 }, 1369 },
1370 "require": { 1370 "require": {
@@ -1414,7 +1414,7 @@
1414 "extraction", 1414 "extraction",
1415 "html" 1415 "html"
1416 ], 1416 ],
1417 "time": "2015-09-20 19:05:55" 1417 "time": "2015-09-23 19:09:38"
1418 }, 1418 },
1419 { 1419 {
1420 "name": "jdorn/sql-formatter", 1420 "name": "jdorn/sql-formatter",
@@ -2970,20 +2970,20 @@
2970 }, 2970 },
2971 { 2971 {
2972 "name": "symfony/symfony", 2972 "name": "symfony/symfony",
2973 "version": "v2.7.4", 2973 "version": "v2.7.5",
2974 "source": { 2974 "source": {
2975 "type": "git", 2975 "type": "git",
2976 "url": "https://github.com/symfony/symfony.git", 2976 "url": "https://github.com/symfony/symfony.git",
2977 "reference": "1fdf23fe28876844b887b0e1935c9adda43ee645" 2977 "reference": "619528a274647cffc1792063c3ea04c4fa8266a0"
2978 }, 2978 },
2979 "dist": { 2979 "dist": {
2980 "type": "zip", 2980 "type": "zip",
2981 "url": "https://api.github.com/repos/symfony/symfony/zipball/1fdf23fe28876844b887b0e1935c9adda43ee645", 2981 "url": "https://api.github.com/repos/symfony/symfony/zipball/619528a274647cffc1792063c3ea04c4fa8266a0",
2982 "reference": "1fdf23fe28876844b887b0e1935c9adda43ee645", 2982 "reference": "619528a274647cffc1792063c3ea04c4fa8266a0",
2983 "shasum": "" 2983 "shasum": ""
2984 }, 2984 },
2985 "require": { 2985 "require": {
2986 "doctrine/common": "~2.3", 2986 "doctrine/common": "~2.4",
2987 "php": ">=5.3.9", 2987 "php": ">=5.3.9",
2988 "psr/log": "~1.0", 2988 "psr/log": "~1.0",
2989 "twig/twig": "~1.20|~2.0" 2989 "twig/twig": "~1.20|~2.0"
@@ -3036,9 +3036,9 @@
3036 }, 3036 },
3037 "require-dev": { 3037 "require-dev": {
3038 "doctrine/data-fixtures": "1.0.*", 3038 "doctrine/data-fixtures": "1.0.*",
3039 "doctrine/dbal": "~2.2", 3039 "doctrine/dbal": "~2.4",
3040 "doctrine/doctrine-bundle": "~1.2", 3040 "doctrine/doctrine-bundle": "~1.2",
3041 "doctrine/orm": "~2.2,>=2.2.3", 3041 "doctrine/orm": "~2.4,>=2.4.5",
3042 "egulias/email-validator": "~1.2", 3042 "egulias/email-validator": "~1.2",
3043 "ircmaxell/password-compat": "~1.0", 3043 "ircmaxell/password-compat": "~1.0",
3044 "monolog/monolog": "~1.11", 3044 "monolog/monolog": "~1.11",
@@ -3088,7 +3088,7 @@
3088 "keywords": [ 3088 "keywords": [
3089 "framework" 3089 "framework"
3090 ], 3090 ],
3091 "time": "2015-09-08 14:26:39" 3091 "time": "2015-09-25 11:16:52"
3092 }, 3092 },
3093 { 3093 {
3094 "name": "tecnick.com/tcpdf", 3094 "name": "tecnick.com/tcpdf",