]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1163 from wallabag/v2-speed-up-tests
authorNicolas Lœuillet <nicolas@loeuillet.org>
Sat, 28 Mar 2015 09:46:33 +0000 (10:46 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Sat, 28 Mar 2015 09:46:33 +0000 (10:46 +0100)
Speed up tests

.scrutinizer.yml [new file with mode: 0644]
.travis.yml
app/config/config_test.yml
app/config/services.yml

diff --git a/.scrutinizer.yml b/.scrutinizer.yml
new file mode 100644 (file)
index 0000000..547120e
--- /dev/null
@@ -0,0 +1,22 @@
+filter:
+    paths:
+        - src/*
+    excluded_paths:
+        - 'vendor/*'
+        - 'app/*'
+        - 'web/*'
+        - 'src/Wallabag/*Bundle/Tests/*'
+        - '*Test.php'
+
+tools:
+    php_cs_fixer: true
+    php_analyzer: true
+    php_mess_detector: true
+    php_changetracking: true
+    php_code_sniffer: true
+    php_pdepend: true
+    sensiolabs_security_checker: true
+    external_code_coverage: true
+    php_code_coverage: true
+    php_sim: false
+    php_cpd: false
index ff23ad457c907c521c690d0af24b94d1c4ca8651..6e9388263b6d3e3f0db688cadeb4aad22b07596a 100644 (file)
@@ -1,18 +1,45 @@
 language: php
 
+# faster builds on docker-container setup
+sudo: false
+
+# cache vendor dirs
+cache:
+    directories:
+        - vendor
+        - $HOME/.composer/cache
+
 php:
-  - 5.4
-  - 5.5
-  - 5.6
+    - 5.4
+    - 5.5
+    - 5.6
+    - hhvm
+    - nightly
+
+matrix:
+    fast_finish: true
+    allow_failures:
+        - php: hhvm
+        - php: nightly
 
 branches:
-  only:
-    - v2
+    only:
+        - v2
 
+install:
+    - composer self-update
+
+# build coverage only on one build, to speed up results feedbacks
 before_script:
-  - composer self-update
-  - echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+    - if [[ "$TRAVIS_PHP_VERSION" = "5.6" ]]; then PHPUNIT_FLAGS="--coverage-clover=coverage.clover"; fi;
 
 script:
-  - ant prepare
-  - phpunit --coverage-text
+    - ant prepare
+    - phpunit $PHPUNIT_FLAGS
+
+after_script:
+    - |
+        if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
+            wget https://scrutinizer-ci.com/ocular.phar
+            php ocular.phar code-coverage:upload --format=php-clover coverage.clover
+        fi
index a6ead1e82386f172efc7ca77abbfb2ae17d008b7..32156963e086e5bedc2fcca7d58407ce2376eb20 100644 (file)
@@ -20,3 +20,10 @@ doctrine:
         driver: pdo_sqlite
         path: %kernel.root_dir%/../data/db/wallabag_test.sqlite
         host: localhost
+    orm:
+        metadata_cache_driver:
+            type: service
+            id: filesystem_cache
+        query_cache_driver:
+            type: service
+            id: filesystem_cache
index 91a03e10e13d5d03612c1e18a910db5e2143456a..af22d3818cd7880c02c7ac8f67cbd610992b9242 100644 (file)
@@ -6,6 +6,8 @@ parameters:
     security.validator.user_password.class: Wallabag\CoreBundle\Security\Validator\WallabagUserPasswordValidator
 
 services:
-#    service_name:
-#        class: AppBundle\Directory\ClassName
-#        arguments: ["@another_service_name", "plain_value", "%parameter_name%"]
+    # used for tests
+    filesystem_cache:
+        class: Doctrine\Common\Cache\FilesystemCache
+        arguments:
+            - %kernel.cache_dir%/doctrine/metadata