diff --git a/.travis.yml b/.travis.yml index 316927f57..a2b5bf217 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,20 @@ dist: trusty sudo: required notifications: - email: false + email: + - me+tv@zammad.com +env: + - DB=mysql + - DB=postgresql addons: + postgresql: "9.4" apt: packages: - mysql-server-5.6 - mysql-client-core-5.6 - mysql-client-5.6 services: + - postgresql - mysql language: ruby rvm: @@ -16,13 +22,17 @@ rvm: before_install: - 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 - - mysql -u root -e "CREATE USER 'some_user'@'localhost' IDENTIFIED BY 'some_pass';" - - mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'localhost';" - - export RAILS_ENV=development - - cp config/database.yml.dist config/database.yml + - if [ "${DB}" = "mysql" ]; then mysql -u root -e "CREATE USER 'some_user'@'localhost' IDENTIFIED BY 'some_pass';"; fi + - if [ "${DB}" = "mysql" ]; then mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'localhost';"; fi + - if [ "${DB}" = "mysql" ]; then cp config/database.yml.test-mysql config/database.yml; fi + - 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: -- bundle install --without postgres + - if [ "${DB}" = "mysql" ]; then bundle install --without postgres; fi + - if [ "${DB}" = "postgresql" ]; then bundle install; fi script: +- bundle exec rubocop - rake db:create - rake db:migrate - rake db:seed @@ -30,3 +40,17 @@ script: - rake test:controllers - rake assets:precompile - 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 diff --git a/test/unit/ticket_overview_test.rb b/test/unit/ticket_overview_test.rb index c31952e26..3f49d40ec 100644 --- a/test/unit/ticket_overview_test.rb +++ b/test/unit/ticket_overview_test.rb @@ -548,7 +548,8 @@ class TicketOverviewTest < ActiveSupport::TestCase assert_equal(result[2][:tickets].class, Array) assert(result[2][:tickets].empty?) - sleep 1 + travel_to Time.zone.now + 1.second # because of mysql millitime issues + ticket3 = Ticket.create( title: 'overview test 3', group: Group.lookup(name: 'OverviewTest'),