projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
18943: Tweaking fixtures
[arvados.git]
/
services
/
api
/
test
/
test_helper.rb
diff --git
a/services/api/test/test_helper.rb
b/services/api/test/test_helper.rb
index 12e642d0ebe7d44c127e8e13a5a094bf3fe2b750..843d4f1b23fccfb8777883c3021ab54187b3cf57 100644
(file)
--- a/
services/api/test/test_helper.rb
+++ b/
services/api/test/test_helper.rb
@@
-25,7
+25,6
@@
unless ENV["NO_COVERAGE_TEST"]
SimpleCov.start do
add_filter '/test/'
add_filter 'initializers/secret_token'
SimpleCov.start do
add_filter '/test/'
add_filter 'initializers/secret_token'
- add_filter 'initializers/omniauth'
end
rescue Exception => e
$stderr.puts "SimpleCov unavailable (#{e}). Proceeding without."
end
rescue Exception => e
$stderr.puts "SimpleCov unavailable (#{e}). Proceeding without."
@@
-62,7
+61,7
@@
class ActiveSupport::TestCase
include ArvadosTestSupport
include CurrentApiClient
include ArvadosTestSupport
include CurrentApiClient
-
teardown
do
+
setup
do
Thread.current[:api_client_ip_address] = nil
Thread.current[:api_client_authorization] = nil
Thread.current[:api_client_uuid] = nil
Thread.current[:api_client_ip_address] = nil
Thread.current[:api_client_authorization] = nil
Thread.current[:api_client_uuid] = nil
@@
-72,6
+71,14
@@
class ActiveSupport::TestCase
restore_configuration
end
restore_configuration
end
+ teardown do
+ # Confirm that any changed configuration doesn't include non-symbol keys
+ $arvados_config.keys.each do |conf_name|
+ conf = Rails.configuration.send(conf_name)
+ confirm_keys_as_symbols(conf, conf_name) if conf.respond_to?('keys')
+ end
+ end
+
def assert_equal(expect, *args)
if expect.nil?
assert_nil(*args)
def assert_equal(expect, *args)
if expect.nil?
assert_nil(*args)
@@
-108,11
+115,6
@@
class ActiveSupport::TestCase
end
def restore_configuration
end
def restore_configuration
- # Confirm that any changed configuration doesn't include non-symbol keys
- $arvados_config.keys.each do |conf_name|
- conf = Rails.configuration.send("#{conf_name}")
- confirm_keys_as_symbols(conf, conf_name) if conf.respond_to?('keys')
- end
# Restore configuration settings changed during tests
ConfigLoader.copy_into_config $arvados_config, Rails.configuration
ConfigLoader.copy_into_config $remaining_config, Rails.configuration
# Restore configuration settings changed during tests
ConfigLoader.copy_into_config $arvados_config, Rails.configuration
ConfigLoader.copy_into_config $remaining_config, Rails.configuration
@@
-120,6
+122,7
@@
class ActiveSupport::TestCase
def set_user_from_auth(auth_name)
client_auth = api_client_authorizations(auth_name)
def set_user_from_auth(auth_name)
client_auth = api_client_authorizations(auth_name)
+ client_auth.user.forget_cached_group_perms
Thread.current[:api_client_authorization] = client_auth
Thread.current[:api_client] = client_auth.api_client
Thread.current[:user] = client_auth.user
Thread.current[:api_client_authorization] = client_auth
Thread.current[:api_client] = client_auth.api_client
Thread.current[:user] = client_auth.user