diff options
author | Matthieu Aubry <matt@piwik.org> | 2014-08-11 04:22:30 +0400 |
---|---|---|
committer | Matthieu Aubry <matt@piwik.org> | 2014-08-11 04:22:30 +0400 |
commit | f69187c3633ee951c9c7643b03492474ab420c14 (patch) | |
tree | 8ee9f378e5075715507f7eed3c33a5a6741a5dd6 /.travis.yml | |
parent | 487d0cdd0f80c56ceb78903473feb638841a2298 (diff) | |
parent | 63eaed6f7cfd30fde46724018a67fb8712bbb2d6 (diff) |
Merge pull request #5962 from piwik/travis_system
Created unified system for running tests in travis for Piwik Core and any Piwik plugin.
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml index cc18c272ae..bed2a8a08b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +# do not edit this file manually, instead run the generate:travis-yml console command + language: php # We want to test against PHP 5.3.3/5.4/5.5 @@ -23,8 +25,10 @@ env: - TEST_SUITE=JavascriptTests MYSQL_ADAPTER=PDO_MYSQL - TEST_SUITE=AngularJSTests MYSQL_ADAPTER=PDO_MYSQL global: + - PIWIK_ROOT_DIR=$TRAVIS_BUILD_DIR - secure: "AMhZmPZx4SUcuZRBzGHlQPxzM4D8FvFB3UThDa52gbi9KIBrwcumzV2VGi6B\n5fgjwtB4XTE1In7qhY2HMikPWBmWYYOQ5QcMPJsqqHt4iMmahx8WKzne6NOk\nNpqAuje/fulNGeP2LJZi0nrub3Fh4VwXaOvpNloKNQN/2JuqPtM=" - secure: "DySde80fX3dw0osGY5s5lGiGLjMleUkkONsuRDC4xjT1hAQP94FGHpPXVZV8\nAQY0s8MQmcK2eRLOQrmE9Bh1XXbGqh40s66XhSWq0hulFHxQH5OLaZXccFeu\n5WxGkHXnNDIc+CVhXW/IIbHZPO1K6hffS8fuvP1o6mYgxwFL6Xw=" + - secure: "CW73pDjcaabpSL7bWiWIQLydKmvLzA1gWNv/zK0VcAKezQtCAQbqpIY1+B56wOhkaCWa7P+xdd2gUWEtvvdRKEC0sZcgCdHD5pQx390e5PWCMQTFO+doAElI4w4DMATCbH890Wcw2rotiZcjlkPYY+urIpUlcRsl6mMtBVQuQ9c=" matrix: allow_failures: @@ -75,53 +79,74 @@ matrix: - php: hhvm env: TEST_SUITE=CoreTests MYSQL_ADAPTER=MYSQLI - -script: ./travis.sh +script: $PIWIK_ROOT_DIR/tests/travis/travis.sh before_install: - - # do not use the Zend allocator on PHP 5.3.3 since it will randomly segfault after program execution - - '[[ "$TRAVIS_PHP_VERSION" == "5.3.3" ]] && export USE_ZEND_ALLOC=0 || true' + # do not use the Zend allocator on PHP 5.3 since it will randomly segfault after program execution + - '[[ "$TRAVIS_PHP_VERSION" == 5.3* ]] && export USE_ZEND_ALLOC=0 || true' before_script: + - ./tests/travis/configure_git.sh + + # print out mysql information - mysql --version - mysql -e "SELECT VERSION();" + + # configure mysql - mysql -e "SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION'" # Travis default + # Uncomment to enable sql_mode STRICT_TRANS_TABLES (new default in Mysql 5.6) #- mysql -e "SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES'" - mysql -e "SELECT @@sql_mode;" - mysql -e "SHOW GLOBAL VARIABLES;" - # Setup Piwik stack + + # Start UI tests - ./tests/travis/initiate_ui_tests.sh # travis now complains about this failing 9 times out of 10, so removing it. hopefully the random failures it prevented won't come back # - travis_retry composer self-update + - travis_retry composer install + + # print out more debugging info - uname -a - date - php -r "var_dump(gd_info());" - mysql -e 'create database piwik_tests;' + # Make sure we use Python 2.6 - travis_retry sudo add-apt-repository ppa:fkrull/deadsnakes -y - travis_retry sudo apt-get update - travis_retry sudo apt-get install python2.6 python2.6-dev + # Log Analytics works with Python 2.6 or 2.7 but we want to test on 2.6 - python2.6 --version - python --version + - ./tests/travis/prepare.sh - ./tests/travis/setup_webserver.sh - - cd tests/PHPUnit -after_success: - - cd $TRAVIS_BUILD_DIR - - ./tests/travis/generate_docs.sh + - export GENERATE_TRAVIS_YML_COMMAND='php ./console generate:travis-yml --core' + - ./tests/travis/autoupdate_travis_yml.sh + + - cd tests/PHPUnit after_script: + # change directory back to root travis dir + - cd $PIWIK_ROOT_DIR + + # output contents of files w/ debugging info to screen - cat /var/log/nginx/error.log - - cat $TRAVIS_BUILD_DIR/tmp/php-fpm.log - - cat $TRAVIS_BUILD_DIR/tmp/logs/piwik.log - - cat $TRAVIS_BUILD_DIR/config/config.ini.php - - cd $TRAVIS_BUILD_DIR + - cat $PIWIK_ROOT_DIR/tmp/php-fpm.log + - cat $PIWIK_ROOT_DIR/tmp/logs/piwik.log + - cat $PIWIK_ROOT_DIR/config/config.ini.php + + # upload test artifacts (for debugging travis failures) - ./tests/travis/upload_artifacts.sh +after_success: + - cd $PIWIK_ROOT_DIR + - ./tests/travis/generate_docs.sh + notifications: slack: rooms: |