diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-08-10 17:52:37 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-08-10 17:52:37 +0400 |
commit | e6cc26c642c0bb9b37aa66e614362401c4705821 (patch) | |
tree | 8209763480ddabb093235c67053f158d5588c014 /.travis.yml | |
parent | 312ac10d6a1cc37ba094fe895583254687662289 (diff) |
Created unified system for running tests in travis for Piwik Core and any Piwik plugin. System includes a console command (generate:travis-yml) that generates a .travis.yml file for a plugin or core. The travis file will check in travis if it needs to be updated, and if so it will fail the build and tell the user. If a specific command line option is specified supplying a github user token, the .travis.yml file will be updated within travis automatically.
Notes:
- comments and non-travis sections will be preserved
- includes logic for plugins to test themselves against latest stable version instead of just on master
- the system is primarily controlled by environment variables. developers can change/add variables in .travis.yml and the auto-updating will preserve the changes.
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 452094194f..548ee5a183 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: @@ -79,53 +83,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: |