#233 Failed Travis builds

This commit is contained in:
Karel Picman 2014-03-11 11:01:14 +01:00
parent 095271d575
commit 3cda9e1254
3 changed files with 26 additions and 20 deletions

View File

@ -18,6 +18,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Load the normal Rails helper
#require File.expand_path("#{Rails.root}/test/test_helper")
# Use fixtures from redmine
#ActiveSupport::TestCase.fixture_path = "#{Rails.root}/test/fixtures"
module RedmineDmsf
module Test
class UnitTest < ActiveSupport::TestCase
@ -25,11 +31,13 @@ module RedmineDmsf
# Allow us to override the fixtures method to implement fixtures for our plugin.
# Ultimately it allows for better integration without blowing redmine fixtures up,
# and allowing us to suppliment redmine fixtures if we need to.
def self.fixtures(*table_names)
dir = File.expand_path( File.dirname(__FILE__) + '../../../../test/fixtures')
table_names.each{|x,i|
ActiveRecord::Fixtures.create_fixtures(dir, x) if File.exist?("#{dir}/#{x}.yml")
}
def self.fixtures(*table_names)
dir = File.expand_path('../../../../test/fixtures', __FILE__)
table_names.each do |x|
if File.exist?("#{dir}/#{x}.yml")
ActiveRecord::Fixtures.create_fixtures(dir, x)
end
end
super(table_names)
end

View File

@ -46,8 +46,8 @@ run_tests()
cd $PATH_TO_REDMINE
mkdir -p coverage
ln -sf `pwd`/coverage $WORKSPACE
#mkdir -p coverage
#ln -sf `pwd`/coverage $WORKSPACE
# Run tests within application - for some reason redmine:plugins:test wont work under 1.8
bundle exec rake redmine:plugins:test:units NAME=redmine_dmsf
@ -61,7 +61,7 @@ uninstall()
cd $PATH_TO_REDMINE
# clean up database
bundle exec rake $MIGRATE_PLUGINS NAME=redmine_dmsf VERSION=0 RAILS_ENV=test
bundle exec rake $MIGRATE_PLUGINS NAME=redmine_dmsf VERSION=0 RAILS_ENV=development
#bundle exec rake $MIGRATE_PLUGINS NAME=redmine_dmsf VERSION=0 RAILS_ENV=development
}
run_install()
@ -90,20 +90,21 @@ run_install()
# run redmine database migrations
bundle exec rake db:migrate RAILS_ENV=test --trace
bundle exec rake db:migrate RAILS_ENV=development --trace
#bundle exec rake db:migrate RAILS_ENV=development --trace
# install redmine database
bundle exec rake redmine:load_default_data REDMINE_LANG=en RAILS_ENV=development
# Load redmine database default data
#bundle exec rake redmine:load_default_data REDMINE_LANG=en RAILS_ENV=development
bundle exec rake redmine:load_default_data REDMINE_LANG=en RAILS_ENV=test
# generate session store/secret token
bundle exec rake $GENERATE_SECRET
# enable development features
touch dmsf.dev
#touch dmsf.dev
# run dmsf database migrations
bundle exec rake $MIGRATE_PLUGINS RAILS_ENV=test
bundle exec rake $MIGRATE_PLUGINS RAILS_ENV=development
#bundle exec rake $MIGRATE_PLUGINS RAILS_ENV=development
}
while getopts :irtu opt

View File

@ -1,7 +1,8 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-14 Karel Picman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -18,8 +19,4 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Load the normal Rails helper
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
# Use fixtures from redmine
ActiveSupport::TestCase.fixture_path = File.dirname(__FILE__) + '/../../../test/fixtures'
require File.expand_path('../../../../test/test_helper', __FILE__)