Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (85 sloc) 4.51 KB
# Travis CI configuration
language: php
php:
- "5.4"
services: mysql
addons:
firefox: "28.0"
# sudo to install imagemagick
sudo: true
env:
global:
- DATABASE='drupal_pantheon_travis'
- DB_USERNAME='root'
- DB_ENCODE='utf8'
- PROJECT_UUID='7abf5430-7a80-46d1-8adc-e56e6ecb8947'
before_install:
- mysql -e "create database IF NOT EXISTS drupal_test;" -uroot
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "wget http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar"
- "java -jar selenium-server-standalone-2.39.0.jar > /tmp/selenium.log 2> /tmp/selenium.error &"
install:
- composer global require drush/drush:6.*
- export PATH="$HOME/.composer/vendor/bin:$PATH"
before_script:
#- export DISPLAY=:99.0
#- sh -e /etc/init.d/xvfb start
- sudo apt-get update -q
- sudo apt-get install -y imagemagick postfix
- printf "\n" | pecl install imagick
# configure mysql
# try to avoid mysql has gone away errors
- mysql -e "SET GLOBAL wait_timeout = 36000;"
- mysql -e "SET GLOBAL max_allowed_packet = 134209536;"
- mysql -e "SHOW VARIABLES LIKE 'max_allowed_packet';"
- mysql -e "SHOW VARIABLES LIKE 'wait_timeout';"
script:
# https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/
#- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
#- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
#- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
# https://github.com/travis-ci/travis-ci/issues/965
# https://github.com/twbs/bootstrap/blob/e3f4072a9e1f1163c5b7b6a52d9b2632569f90fb/.travis.yml#L9
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
- echo "$TRAVIS_COMMIT_MSG"
- DB_URL=mysql://$DB_USERNAME@127.0.0.1/$DATABASE
# https://www.drupal.org/node/1488650#comment-6741902
- drush site-install testing install_configure_form.update_status_module='array(FALSE,FALSE)' --db-url=$DB_URL --site-name=my-site --yes
- drush dl drulenium-7.x-2.x-dev -y
- drush en drulenium drulenium_local_selenium -y
#- drush en drulenium_tests -y
#- drush en libraries -y
- drush vr-download-webdriver # To download selenium webdriver library
- drush vset --yes drulenium_vr_config_server_opt 'drulenium_local_selenium'
# Desktop width breaks pages like http://8-2-x-drulenium-drupal8.pantheonsite.io/admin/config/search/path/add excluding URL
- drush vset --yes drulenium_vr_release_selenium_browser_width '720'
- drush vset --yes drulenium_vr_release_selenium_browser_height '1280'
- drush vset --yes drulenium_vr_config_image_server_opt 'local'
- drush vset --yes drulenium_vr_release_imagemagick_path '/usr/bin'
- drush vset --yes drulenium_vr_release_notify_email 'bot@technikh.com'
# Test as admin user
- drush vset --yes drulenium_vr_release_user_name 'admin' -q
- drush vset --yes drulenium_vr_release_user_pass $DRUPAL8_ADMIN_PASS -q
# http://drulenium.org/api/v1/project/7abf5430-7a80-46d1-8adc-e56e6ecb8947
- export TEST_PAGES=$(echo `curl -s http://drulenium.org/api/v1/project/$PROJECT_UUID | jq -r '.tests | join(",")'`)
- echo "$TEST_PAGES";
- IFS=',' read -ra ADDR <<< "$TEST_PAGES"
- for i in "${ADDR[@]}"; do drush vr-test-import $i travis-regression; done
#- drush vr-test-import http://drulenium.org/api/v1/test-case/92275f91-80fc-4bca-a370-6105822fe088 travis-regression
#- drush vr-test-import http://drulenium.org/api/v1/test-case/c2fdabce-77a1-4d34-8895-4317a62517c0 travis-regression
#- drush vr-test-import http://drulenium.org/api/v1/test-case/e883f1d6-e949-4e54-8576-2a5dad8fb4b1 travis-regression
#- drush vr-test-import http://drulenium.org/api/v1/test-case/9e18577d-802a-4f71-ba4b-6825ba7e129d travis-regression
# http://8-1-x-drulenium-drupal8.pantheonsite.io/ $TRAVIS_BRANCH = 8-1-x
- drush vrc http://$TRAVIS_BRANCH-drulenium-drupal8.pantheonsite.io/ "$TRAVIS_COMMIT_MSG" --preset_category=travis-regression
- drush vrc http://$TRAVIS_BRANCH-arch-drulenium-drupal8.pantheonsite.io/ "$TRAVIS_COMMIT_MSG" --preset_category=travis-regression
- drush vr-diff --preset_category=travis-regression
- drush dl drulenium_imgur
- drush en drulenium_imgur -y
- drush imgur-download-client -y
- drush vset --yes drulenium_imgur_client_id $IMGUR_CLIENT_ID -q
- drush vset --yes drulenium_imgur_client_secret $IMGUR_CLIENT_SECRET -q
- drush vr-diff-upload --preset_category=travis-regression --project_id=$PROJECT_UUID
branches:
except:
- master