Travis ci improvements (mysql + postgresql + more tests).

This commit is contained in:
Martin Edenhofer 2016-11-30 14:34:15 +01:00
parent 23c9316f11
commit 9633d211ed
2 changed files with 32 additions and 7 deletions

View file

@ -1,14 +1,20 @@
dist: trusty dist: trusty
sudo: required sudo: required
notifications: notifications:
email: false email:
- me+tv@zammad.com
env:
- DB=mysql
- DB=postgresql
addons: addons:
postgresql: "9.4"
apt: apt:
packages: packages:
- mysql-server-5.6 - mysql-server-5.6
- mysql-client-core-5.6 - mysql-client-core-5.6
- mysql-client-5.6 - mysql-client-5.6
services: services:
- postgresql
- mysql - mysql
language: ruby language: ruby
rvm: rvm:
@ -16,13 +22,17 @@ rvm:
before_install: before_install:
- sudo apt-get -qq update - sudo apt-get -qq update
- sudo apt-get install -y curl git-core patch build-essential bison zlib1g-dev libssl-dev libxml2-dev libxml2-dev sqlite3 libsqlite3-dev autotools-dev libxslt1-dev libyaml-0-2 autoconf automake libreadline6-dev libyaml-dev libtool libgmp-dev libgdbm-dev libncurses5-dev pkg-config libffi-dev libmysqlclient-dev postfix - sudo apt-get install -y curl git-core patch build-essential bison zlib1g-dev libssl-dev libxml2-dev libxml2-dev sqlite3 libsqlite3-dev autotools-dev libxslt1-dev libyaml-0-2 autoconf automake libreadline6-dev libyaml-dev libtool libgmp-dev libgdbm-dev libncurses5-dev pkg-config libffi-dev libmysqlclient-dev postfix
- mysql -u root -e "CREATE USER 'some_user'@'localhost' IDENTIFIED BY 'some_pass';" - if [ "${DB}" = "mysql" ]; then mysql -u root -e "CREATE USER 'some_user'@'localhost' IDENTIFIED BY 'some_pass';"; fi
- mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'localhost';" - if [ "${DB}" = "mysql" ]; then mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'localhost';"; fi
- export RAILS_ENV=development - if [ "${DB}" = "mysql" ]; then cp config/database.yml.test-mysql config/database.yml; fi
- cp config/database.yml.dist config/database.yml - if [ "${DB}" = "postgresql" ]; then psql -c 'create database zammad_test;' -U postgres; fi
- if [ "${DB}" = "postgresql" ]; then cp config/database.yml.test-postgresql config/database.yml; fi
- export RAILS_ENV=test
install: install:
- bundle install --without postgres - if [ "${DB}" = "mysql" ]; then bundle install --without postgres; fi
- if [ "${DB}" = "postgresql" ]; then bundle install; fi
script: script:
- bundle exec rubocop
- rake db:create - rake db:create
- rake db:migrate - rake db:migrate
- rake db:seed - rake db:seed
@ -30,3 +40,17 @@ script:
- rake test:controllers - rake test:controllers
- rake assets:precompile - rake assets:precompile
- rake db:drop - rake db:drop
- rake db:create
- rake db:migrate
- rake db:seed
- ruby -I test/ test/integration/auto_wizard_test.rb
- rake db:drop
- rake db:create
- rake db:migrate
- rake db:seed
- ruby -I test/ test/integration/geo_location_test.rb
- ruby -I test/ test/integration/geo_calendar_test.rb
- ruby -I test/ test/integration/user_agent_test.rb
- ruby -I test/ test/integration/user_device_controller_test.rb
- ruby -I test/ test/integration/sipgate_controller_test.rb
- rake db:drop

View file

@ -548,7 +548,8 @@ class TicketOverviewTest < ActiveSupport::TestCase
assert_equal(result[2][:tickets].class, Array) assert_equal(result[2][:tickets].class, Array)
assert(result[2][:tickets].empty?) assert(result[2][:tickets].empty?)
sleep 1 travel_to Time.zone.now + 1.second # because of mysql millitime issues
ticket3 = Ticket.create( ticket3 = Ticket.create(
title: 'overview test 3', title: 'overview test 3',
group: Group.lookup(name: 'OverviewTest'), group: Group.lookup(name: 'OverviewTest'),