Skip to content

Commit

Permalink
Rails 4.1 upgrade (publiclab#1799)
Browse files Browse the repository at this point in the history
* rails 4 find_by and assert_not conventions

* assert_not prep for rails 4

* bin, form_for, and other rails 4 reqs

* config changes for rails 4

* regex no longer multiline

* non-multiline regex pt 2

* further regex fixes

* missing parenthesis

* last regex fix, i hope

* added bin/

* resolved plurality issues

* fixtures disentangling

* passing more functional tests

* further fixtures and table name fixes

* major refactor of .references() after actually reading docs

* further debugging

* down to 86 functional test errors

* fixed date helpers

* down to 36 functional test errors

* down to 50 functional test errors

* down to 6 errors

* down to 1 functional test errors

* addressing functional test errors

* getting closer

* user sessions fixes

* integration and unit test error resolutions

* down to 2 failures overall

* all tests passing!

* small fix

* searches test route

* small changes

* adding travis solr log output

* Update routes.rb

* Update .travis.yml

* Update searches_controller_test.rb

* Update .travis.yml

* Update searches_controller_test.rb

* Update node_search_test.rb

* Update node_search_test.rb

* Update searches_controller_test.rb

* moved custom rake tasks to Rakefile

* Update node_search_test.rb

* reactivate default test tasks

* removed inline reindex

* rake test:run tweak

* invoke instead of execute rake tasks

* sorted rakefile issues maybe

* test adjustments

* better rakefile output

* execute instead of invoke in Rakefile

* reworking namespace

* Update Rakefile

* Update Rakefile

* Update Dangerfile

* Create TEST_.xml

* Delete TEST_.xml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml
  • Loading branch information
jywarren committed Dec 7, 2017
1 parent cbf6e37 commit 5ffd7c6
Show file tree
Hide file tree
Showing 144 changed files with 1,810 additions and 1,698 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ install:

script:
- docker-compose run -e CI=TRUE web bash -c "GENERATE_REPORT=true rake test:all"
- mkdir -p ./test/reports
- touch ./test/reports/TEST_.xml
- echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml
- tail -n +2 -q ./test/reports/TEST*.xml >> output.xml
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then danger --verbose; fi'
43 changes: 25 additions & 18 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,34 @@ end

message "Pull Request is marked as Work in Progress" if github.pr_title.include? "[WIP]"

junit.parse "output.xml"
junit.failures.collect(&:nodes).flatten.each do |failure|
failure.nodes.each do |f|
match = f.match(/(test[a-z_\/]+.rb):([0-9]+)/)
source_path = match[1]
line = match[2]
if !source_path.nil? && !line.nil?
f = f.gsub(source_path + ':' + line, "<a href='https://github.com/#{github.pr_author}/plots2/tree/#{github.branch_for_head}/#{source_path}#L#{line}'>#{source_path}:#{line}</a>")
begin

junit.parse "output.xml"
junit.failures.collect(&:nodes).flatten.each do |failure|
failure.nodes.each do |f|
match = f.match(/(test[a-z_\/]+.rb):([0-9]+)/)
source_path = match[1]
line = match[2]
if !source_path.nil? && !line.nil?
f = f.gsub(source_path + ':' + line, "<a href='https://github.com/#{github.pr_author}/plots2/tree/#{github.branch_for_head}/#{source_path}#L#{line}'>#{source_path}:#{line}</a>")
end
fail("There was a test failure at: #{f}")
end
fail("There was a test failure at: #{f}")
end
end

junit.errors.collect(&:nodes).flatten.each do |error|
error.nodes.each do |f|
match = f.match(/(test[a-z_\/]+.rb):([0-9]+)/)
source_path = match[1]
line = match[2]
if !source_path.nil? && !line.nil?
f = f.gsub(source_path + ':' + line, "<a href='https://github.com/#{github.pr_author}/plots2/tree/#{github.branch_for_head}/#{source_path}#L#{line}'>#{source_path}:#{line}</a>")
junit.errors.collect(&:nodes).flatten.each do |error|
error.nodes.each do |f|
match = f.match(/(test[a-z_\/]+.rb):([0-9]+)/)
source_path = match[1]
line = match[2]
if !source_path.nil? && !line.nil?
f = f.gsub(source_path + ':' + line, "<a href='https://github.com/#{github.pr_author}/plots2/tree/#{github.branch_for_head}/#{source_path}#L#{line}'>#{source_path}:#{line}</a>")
end
fail("There was a test error at: #{f}")
end
fail("There was a test error at: #{f}")
end

rescue => ex
puts "There was an error with Danger bot's Junit parsing:"
puts ex.message
end
35 changes: 20 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
source 'https://rubygems.org'

gem 'rails', '~> 3.2.20'
gem 'rails', '~> 4.1.16'
gem 'activerecord-session_store'
gem 'protected_attributes'
gem 'passenger'

gem 'rails-i18n', '~> 3.0.0'
gem 'rails-i18n', '~> 4.0.0'
# gem 'responders', '~> 2.0' # for Rails 4.2

# run with `bundle install --without production` or `bundle install --without mysql` to exclude this
group :mysql, :production do
gem 'mysql2', '~> 0.3.20'
Expand All @@ -20,27 +24,25 @@ end
# gem "activerecord-postgresql-adapter"
#end

#letter_opener
gem "letter_opener", :group => :development

# Gems used only for assets and not required in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'execjs' # See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'sass-rails', '~> 4.0.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'execjs' # See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'

# run with `bundle install --without development` to exclude these
group :development do
gem "letter_opener"
gem "nifty-generators"
gem 'byebug'
end

# run with `bundle install --without test` to exclude these
group :test, :development do
gem 'test-unit'
gem 'rails-perftest'
gem 'minitest-reporters', '~> 1.1.19'
gem 'rake', '~> 10.5.0'
# gems to test RESTful API
gem 'rest-client'
Expand All @@ -63,14 +65,17 @@ gem 'jquery-rails'
gem 'rdiscount', '~> 2.2', '>= 2.2.0.1' # Markdown
gem 'will_paginate', '>= 3.0.6'
gem 'will_paginate-bootstrap', '>= 1.0.1'
# could be deprecated:
gem 'georuby', '2.0'
gem 'geokit-rails'

gem 'rails_autolink'
gem 'rb-readline'
gem "paperclip", ">= 4.1.1"
gem "paperclip", "< 4.2.0"
gem "ruby-openid", :require => "openid"
gem "rack-openid"
gem "authlogic", "3.2.0"
gem "authlogic", "~> 3.5.0"
gem 'authlogic-oid'
gem "php-serialize", :require => "php_serialize"
gem 'less-rails', '~> 2.6'
gem 'progress_bar'
Expand All @@ -97,7 +102,7 @@ gem 'http_accept_language'
# The default friendly_id version compatible with Rails 3 is v4.0
gem 'friendly_id'
gem 'jbuilder'
gem 'strong_parameters'
#gem 'strong_parameters'

# Pin mustermann to Ruby 2.1 compatible
gem 'mustermann' , '~> 0.4'
Loading

0 comments on commit 5ffd7c6

Please sign in to comment.