Skip to content

Commit

Permalink
[ci] Enable Style/GlobalVars rubocop cop
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel authored and bgeuken committed Oct 5, 2017
1 parent 4d57860 commit 4d25923
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Style/MultilineBlockChain:
Style/RedundantReturn:
Enabled: false

Style/GlobalVars:
AllowedVariables: ['$rabbitmq_conn', '$rabbitmq_exchange', '$rabbitmq_channel']

##################### Metrics ##################################

# Checks if the length a class exceeds some maximum value
Expand Down
8 changes: 0 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -809,14 +809,6 @@ Style/For:
Style/FormatStringToken:
EnforcedStyle: template

# Offense count: 7
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Exclude:
- 'src/api/test/functional/interconnect_test.rb'
- 'src/api/test/functional/request_controller_test.rb'
- 'src/api/test/functional/source_controller_test.rb'

# Offense count: 111
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/interconnect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def test_read_and_command_tests
assert_xml_tag( tag: 'directory', attributes: { count: '0' } )
get "/source/#{project}?expand=1"
assert_response :success
if $ENABLE_BROKEN_TEST
if @ENABLE_BROKEN_TEST
# FIXME2.4: remote packages get not added yet.
assert_xml_tag( tag: 'directory', attributes: { count: '1' } )
assert_xml_tag( tag: 'entry', attributes: { name: 'pack1', originproject: 'BaseDistro2.0' } )
Expand Down
6 changes: 3 additions & 3 deletions src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ def test_search_and_involved_requests
get '/request?view=collection&user=Iggy&states=new,review'
assert_response :success
assert_xml_tag(tag: 'collection', child: { tag: 'request' })
if $ENABLE_BROKEN_TEST
if @ENABLE_BROKEN_TEST
# FIXME there is no code in this test creating request from HiddenProject

assert_xml_tag(tag: 'source', attributes: { project: 'HiddenProject', package: 'pack' })
Expand All @@ -1255,7 +1255,7 @@ def test_search_and_involved_requests
assert_xml_tag(tag: 'collection', child: { tag: 'request' })
assert_no_xml_tag(tag: 'target', attributes: { project: 'HiddenProject' })

return unless $ENABLE_BROKEN_TEST
return unless @ENABLE_BROKEN_TEST

# ... but adrian gets it
login_adrian
Expand Down Expand Up @@ -2888,7 +2888,7 @@ def test_hidden_add_role_request
login_Iggy
post '/request?cmd=create', params: load_backend_file('request/hidden_add_role_fail')
# should fail as this user shouldn't see the target package at all.
assert_response 404 if $ENABLE_BROKEN_TEST
assert_response 404 if @ENABLE_BROKEN_TEST
reset_auth
login_adrian
post '/request?cmd=create', params: load_backend_file('request/hidden_add_role')
Expand Down
6 changes: 3 additions & 3 deletions src/api/test/functional/source_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def test_can_branch_package_under_two_names
assert_response :success
# this is behaving strange as it's creating a TestPack3 pack, but returns a 400
# as it tries to branch TestPack2 -> TestPack too and fails
if $ENABLE_BROKEN_TEST
if @ENABLE_BROKEN_TEST
post '/source/home:Iggy/TestPack', params: { cmd: 'branch', target_package: 'TestPack3' }
assert_response :success
end
Expand Down Expand Up @@ -1128,7 +1128,7 @@ def test_captial_letter_change
assert_xml_tag tag: 'path', attributes: { project: 'RemoteInstance:home:tom:projectA' }
assert_no_xml_tag tag: 'path', attributes: { project: 'RemoteInstance:home:tom:projecta' }

if $ENABLE_BROKEN_TEST
if @ENABLE_BROKEN_TEST
# FIXME: the case insensitive database select is not okay.
# and switch letter again
put '/source/home:tom:projectB/_meta', params: "<project name='home:tom:projectB'> <title/> <description/> <repository name='repoB'> <path project='RemoteInstance:home:tom:projecta' repository='repoA' /> </repository> </project>"
Expand Down Expand Up @@ -2831,7 +2831,7 @@ def test_copy_package
assert_xml_tag tag: 'revisionlist', children: { count: 1 }

# FIXME: this is not yet supported in backend
if $ENABLE_BROKEN_TEST
if @ENABLE_BROKEN_TEST
# copy with history
post '/source/home:fred/DELETE', params: { cmd: :copy, oproject: 'home:Iggy', opackage: 'TestPack', withhistory: '1' }
assert_response :success
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

# uncomment to enable tests which currently are known to fail, but where either the test
# or the code has to be fixed
# $ENABLE_BROKEN_TEST=true
# @ENABLE_BROKEN_TEST=true

def backend_config
backend_dir_suffix = ""
Expand Down

0 comments on commit 4d25923

Please sign in to comment.