[ARVADOS] updated: 1.3.0-718-g0ebe4a09a
Git user
git at public.curoverse.com
Mon Apr 22 21:43:16 UTC 2019
Summary of changes:
apps/workbench/Gemfile | 1 +
apps/workbench/Gemfile.lock | 5 +++++
apps/workbench/app/controllers/actions_controller.rb | 4 ++--
apps/workbench/app/controllers/application_controller.rb | 6 ++++++
apps/workbench/app/helpers/application_helper.rb | 2 +-
apps/workbench/app/models/arvados_base.rb | 3 +++
.../test/controllers/application_controller_test.rb | 2 +-
.../test/controllers/collections_controller_test.rb | 6 +++++-
apps/workbench/test/controllers/jobs_controller_test.rb | 2 +-
.../workbench/test/controllers/search_controller_test.rb | 16 ++++++++--------
apps/workbench/test/helpers/share_object_helper.rb | 2 +-
11 files changed, 34 insertions(+), 15 deletions(-)
via 0ebe4a09a3d12f1415d2c119e716a2788ff889ec (commit)
via 6024627680c17a54a24e1bd5d78416cf251562d0 (commit)
from caee2ad84cf7a8e7349fc08d0de30e50a93adf13 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 0ebe4a09a3d12f1415d2c119e716a2788ff889ec
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Mon Apr 22 15:56:44 2019 -0300
14988: More deprecation warning fixes on functional tests.
There's just one pending from the wiselinks gem. Will defer fixing it because
it's not conclusive that wiselinks is compatible with rails >= 5.0 yet.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 0200a3d1e..21e9b49fd 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -353,6 +353,9 @@ class ApplicationController < ActionController::Base
def update
@updates ||= params[@object.resource_param_name.to_sym]
+ if @updates.is_a? ActionController::Parameters
+ @updates = @updates.to_unsafe_hash
+ end
@updates.keys.each do |attr|
if @object.send(attr).is_a? Hash
if @updates[attr].is_a? String
@@ -361,6 +364,9 @@ class ApplicationController < ActionController::Base
if params[:merge] || params["merge_#{attr}".to_sym]
# Merge provided Hash with current Hash, instead of
# replacing.
+ if @updates[attr].is_a? ActionController::Parameters
+ @updates[attr] = @updates[attr].to_unsafe_hash
+ end
@updates[attr] = @object.send(attr).with_indifferent_access.
deep_merge(@updates[attr].with_indifferent_access)
end
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 4c4b5ff34..3f72d5a2a 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -25,7 +25,7 @@ module ApplicationHelper
end
def human_readable_bytes_html(n)
- return h(n) unless n.is_a? Fixnum
+ return h(n) unless n.is_a? Integer
return "0 bytes" if (n == 0)
orders = {
diff --git a/apps/workbench/test/controllers/application_controller_test.rb b/apps/workbench/test/controllers/application_controller_test.rb
index 1aea54ca1..1b13d8f32 100644
--- a/apps/workbench/test/controllers/application_controller_test.rb
+++ b/apps/workbench/test/controllers/application_controller_test.rb
@@ -399,7 +399,7 @@ class ApplicationControllerTest < ActionController::TestCase
# network. 100::/64 is the IPv6 discard prefix, so it's perfect.
Rails.configuration.arvados_v1_base = "https://[100::f]:1/"
@controller = NodesController.new
- get(:index, {}, session_for(:active))
+ get(:index, params: {}, session: session_for(:active))
assert_includes(405..422, @response.code.to_i,
"bad response code when API server is unreachable")
ensure
diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb
index fa81f0713..b6995da06 100644
--- a/apps/workbench/test/controllers/collections_controller_test.rb
+++ b/apps/workbench/test/controllers/collections_controller_test.rb
@@ -32,7 +32,11 @@ class CollectionsControllerTest < ActionController::TestCase
def assert_hash_includes(actual_hash, expected_hash, msg=nil)
expected_hash.each do |key, value|
- assert_equal(value, actual_hash[key], msg)
+ if value.nil?
+ assert_nil(actual_hash[key], msg)
+ else
+ assert_equal(value, actual_hash[key], msg)
+ end
end
end
diff --git a/apps/workbench/test/controllers/jobs_controller_test.rb b/apps/workbench/test/controllers/jobs_controller_test.rb
index 1182bcbdd..be876a5a4 100644
--- a/apps/workbench/test/controllers/jobs_controller_test.rb
+++ b/apps/workbench/test/controllers/jobs_controller_test.rb
@@ -6,7 +6,7 @@ require 'test_helper'
class JobsControllerTest < ActionController::TestCase
test "visit jobs index page" do
- get :index, {}, session_for(:active)
+ get :index, params: {}, session: session_for(:active)
assert_response :success
end
diff --git a/apps/workbench/test/controllers/search_controller_test.rb b/apps/workbench/test/controllers/search_controller_test.rb
index c57d70533..e620fbd86 100644
--- a/apps/workbench/test/controllers/search_controller_test.rb
+++ b/apps/workbench/test/controllers/search_controller_test.rb
@@ -13,43 +13,43 @@ class SearchControllerTest < ActionController::TestCase
include Rails.application.routes.url_helpers
test 'Get search dialog' do
- xhr :get, :choose, {
+ get :choose, params: {
format: :js,
title: 'Search',
action_name: 'Show',
action_href: url_for(host: 'localhost', controller: :actions, action: :show),
action_data: {}.to_json,
- }, session_for(:active)
+ }, session: session_for(:active), xhr: true
assert_response :success
end
test 'Get search results for all projects' do
- xhr :get, :choose, {
+ get :choose, params: {
format: :json,
partial: true,
- }, session_for(:active)
+ }, session: session_for(:active), xhr: true
assert_response :success
assert_not_empty(json_response['content'],
'search results for all projects should not be empty')
end
test 'Get search results for empty project' do
- xhr :get, :choose, {
+ get :choose, params: {
format: :json,
partial: true,
project_uuid: api_fixture('groups')['empty_project']['uuid'],
- }, session_for(:active)
+ }, session: session_for(:active), xhr: true
assert_response :success
assert_empty(json_response['content'],
'search results for empty project should be empty')
end
test 'search results for aproject and verify recursive contents' do
- xhr :get, :choose, {
+ get :choose, params: {
format: :json,
partial: true,
project_uuid: api_fixture('groups')['aproject']['uuid'],
- }, session_for(:active)
+ }, session: session_for(:active), xhr: true
assert_response :success
assert_not_empty(json_response['content'],
'search results for aproject should not be empty')
diff --git a/apps/workbench/test/helpers/share_object_helper.rb b/apps/workbench/test/helpers/share_object_helper.rb
index 454cb2c36..e31f19649 100644
--- a/apps/workbench/test/helpers/share_object_helper.rb
+++ b/apps/workbench/test/helpers/share_object_helper.rb
@@ -71,7 +71,7 @@ module ShareObjectHelper
end
def user_can_manage(user_sym, fixture)
- get(:show, {id: fixture["uuid"]}, session_for(user_sym))
+ get(:show, params: {id: fixture["uuid"]}, session: session_for(user_sym))
is_manager = assigns(:user_is_manager)
assert_not_nil(is_manager, "user_is_manager flag not set")
if not is_manager
commit 6024627680c17a54a24e1bd5d78416cf251562d0
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Mon Apr 22 14:03:22 2019 -0300
14988: Removes almost all pending deprecated warnings on functional tests.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index 08cf436f6..30c5bfce8 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -58,6 +58,7 @@ group :test, :performance do
gem 'simplecov', '~> 0.7', require: false
gem 'simplecov-rcov', require: false
gem 'mocha', require: false
+ gem 'rails-controller-testing'
end
gem 'jquery-rails'
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index d1ea71a85..a4c9c24b6 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -228,6 +228,10 @@ GEM
bundler (>= 1.3.0)
railties (= 5.0.7.2)
sprockets-rails (>= 2.0.0)
+ rails-controller-testing (1.0.4)
+ actionpack (>= 5.0.1.x)
+ actionview (>= 5.0.1.x)
+ activesupport (>= 5.0.1.x)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
@@ -348,6 +352,7 @@ DEPENDENCIES
poltergeist (~> 1.5.1)
rack-mini-profiler
rails (~> 5.0.0)
+ rails-controller-testing
rails-perftest
raphael-rails
responders (~> 2.0)
diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index 7e9e29233..065dce521 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -14,8 +14,8 @@ class ActionsController < ApplicationController
params['uuid'] and
model_class.in?([Collection, Group, Job, PipelineInstance, PipelineTemplate])
}
- skip_filter :require_thread_api_token, only: [:report_issue_popup, :report_issue]
- skip_filter :check_user_agreements, only: [:report_issue_popup, :report_issue]
+ skip_around_action :require_thread_api_token, only: [:report_issue_popup, :report_issue]
+ skip_before_action :check_user_agreements, only: [:report_issue_popup, :report_issue]
@@exposed_actions = {}
def self.expose_action method, &block
diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index 5dd585152..aa25ac439 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -185,6 +185,9 @@ class ArvadosBase < ApplicationRecord
# The following permit! is necessary even with
# "ActionController::Parameters.permit_all_parameters = true",
# because permit_all does not permit nested attributes.
+ if raw_params.is_a? ActionController::Parameters
+ raw_params = raw_params.to_unsafe_h
+ end
ActionController::Parameters.new(raw_params).permit!
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list