[ARVADOS] created: 1.3.0-1762-gf2d88aeb9
Git user
git at public.curoverse.com
Fri Oct 18 22:08:07 UTC 2019
at f2d88aeb934c9159c32e86371668428aa82ccdac (commit)
commit f2d88aeb934c9159c32e86371668428aa82ccdac
Merge: 7d8bf1e2c beb4aebe0
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Fri Oct 18 19:04:08 2019 -0300
15716: Merge branch 'master' into 15716-api-keepservice-list-fix
commit 7d8bf1e2c1c487ef24c98b2e79855e6ff6beec76
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Fri Oct 18 19:01:54 2019 -0300
15716: Fix tests by importing CurrentApiClient module on missing places
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/api/app/helpers/commits_helper.rb b/services/api/app/helpers/commits_helper.rb
index b1c02b2a7..fdb83a037 100644
--- a/services/api/app/helpers/commits_helper.rb
+++ b/services/api/app/helpers/commits_helper.rb
@@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0
module CommitsHelper
+ extend CurrentApiClient
class GitError < RequestError
def http_status
diff --git a/services/api/app/models/keep_service.rb b/services/api/app/models/keep_service.rb
index 60f263202..f76f5e47a 100644
--- a/services/api/app/models/keep_service.rb
+++ b/services/api/app/models/keep_service.rb
@@ -7,6 +7,7 @@ class KeepService < ArvadosModel
include KindAndEtag
include CommonApiTemplate
extend DbCurrentTime
+ extend CurrentApiClient
SERVER_START_TIME = db_current_time
commit 21fe2b7c02453ce569325d5aa8e29c5c4f98bc22
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Fri Oct 18 18:44:49 2019 -0300
15716: Don't include modules on .rake files
The file symbols.rake used to include CurrentApiClient, making its methods
available to the entire app as Object class methods.
This made several tests to pass successfully while the code they exercised
really fail on production and development environments.
The solution is to make a helper class that works as a namespace of those
methods.
This commit exposes 41 failing tests.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/api/lib/tasks/symbols.rake b/services/api/lib/tasks/symbols.rake
index a2e6df8b5..dc9ed461d 100644
--- a/services/api/lib/tasks/symbols.rake
+++ b/services/api/lib/tasks/symbols.rake
@@ -4,7 +4,12 @@
require 'current_api_client'
-include CurrentApiClient
+# This is needed instead of just including CurrentApiClient so that its
+# methods don't get imported as Object's class methods; this is a problem because
+# the methods would be imported only on test environment. See #15716 for more info.
+class CurrentApiClientHelper
+ extend CurrentApiClient
+end
def has_symbols? x
if x.is_a? Hash
@@ -83,7 +88,7 @@ namespace :symbols do
Node, PipelineInstance, PipelineTemplate,
Repository, Specimen, Trait, User, VirtualMachine,
Workflow].each do |klass|
- act_as_system_user do
+ CurrentApiClientHelper.act_as_system_user do
klass.all.each do |c|
check_for_serialized_symbols c
end
@@ -99,7 +104,7 @@ namespace :symbols do
Node, PipelineInstance, PipelineTemplate,
Repository, Specimen, Trait, User, VirtualMachine,
Workflow].each do |klass|
- act_as_system_user do
+ CurrentApiClientHelper.act_as_system_user do
klass.all.each do |c|
stringify_serialized_symbols c
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list