Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 29 additions & 42 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,31 @@
---
language: ruby
sudo: false
cache:
directories:
- workspace/redmine/vendor/bundle
timeouts:
bundle: 600
rvm:
- 1.9.3
- 2.0.0
- 2.2.0
env:
global:
- REDMINE_DIR=./workspace/redmine
- PLUGIN_NAME=redmine_exception_handler
matrix:
- REDMINE=3.0-stable
- REDMINE=v3.8.0
- REDMINE=master
dist: xenial

services:
- mysql

matrix:
exclude:
- rvm: 2.0.0
env: REDMINE=v3.8.0
gemfile: workspace/redmine/Gemfile
- rvm: 2.2.0
env: REDMINE=v3.8.0
gemfile: workspace/redmine/Gemfile
allow_failures:
- env: REDMINE=v3.8.0
gemfile: workspace/redmine/Gemfile
include:
- name: "Redmine 3.4"
env:
- REDMINE_VERSION=3.4-stable
install:
- gem install bundler -v "1.17.3"
- bundle _1.17.3_ install
- bin/rake db:create
- bin/rake generate_secret_token
- bin/rake db:migrate
- bin/rake redmine:plugins:migrate
script:
- RAILS_ENV=test bin/rake redmine:plugins:test:integration

before_install:
- ./script/ci.sh clone_redmine --target $REDMINE_DIR
- cp ./config/database.yml.travis $REDMINE_DIR/config/database.yml
- ./script/ci.sh install_plugin_gemfile
install: ./script/ci.sh bundle_install
before_script:
- mysql -e 'CREATE DATABASE redmine CHARACTER SET utf8;'
- ./script/ci.sh prepare_redmine
- ./script/ci.sh prepare_plugin
- 'phantomjs --webdriver 4444 2>&- 1>&- &'
script:
- ./script/ci.sh run_tests
- ./script/ci.sh test_uninstall
- cd ..
- git clone
--depth 1
--branch ${REDMINE_VERSION}
https://github.com/redmine/redmine.git
- cd redmine/plugins
- ln -s ../../redmine_exception_handler ./
- cd ../
- cp config/database.yml{.example,}
- unset BUNDLE_GEMFILE
6 changes: 0 additions & 6 deletions config/Gemfile.travis

This file was deleted.

5 changes: 0 additions & 5 deletions config/database.yml.travis

This file was deleted.

2 changes: 1 addition & 1 deletion lib/exception_handler/redmine_notifier_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def notify_exception_with_database(exception, options = {})
end

end
end
end
77 changes: 0 additions & 77 deletions lib/tasks/testing.rake

This file was deleted.

176 changes: 0 additions & 176 deletions script/ci.sh

This file was deleted.

19 changes: 19 additions & 0 deletions test/integration/redmine_exception_handler_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require File.expand_path("../../test_helper", __FILE__)

class RedmineExceptionHandlerTest < Redmine::IntegrationTest
def test_exception
assert_difference 'ActionMailer::Base.deliveries.size', 1 do
get "/example_exception"
end
mail = ActionMailer::Base.deliveries.last
settings = Setting.plugin_redmine_exception_handler
assert_equal([
settings["exception_handler_recipients"],
settings["exception_handler_sender_address"],
],
[
mail.to.join(", "),
mail.header["From"].value,
])
end
end
24 changes: 1 addition & 23 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1 @@
require 'simplecov'

SimpleCov.start do
add_group 'Controllers', 'app/controllers'
add_group 'Models', 'app/models'
add_group 'Helpers', 'app/helpers'
add_group 'Libraries', 'lib'
add_filter '/test/'
add_filter 'init.rb'
root File.expand_path(File.dirname(__FILE__) + '/../')
end if RUBY_VERSION >= '1.9.0'

require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')

Rails.backtrace_cleaner.remove_silencers!

class ActiveSupport::TestCase
self.fixture_path = File.expand_path(File.dirname(__FILE__) + '/fixtures')
end

class ActionDispatch::IntegrationTest
self.fixture_path = File.expand_path(File.dirname(__FILE__) + '/fixtures')
end
require File.expand_path("../../../../test/test_helper", __FILE__)