Skip to content

Commit

Permalink
Fix deprecation of Socket.gethostbyname
Browse files Browse the repository at this point in the history
It appears on the output of OpenQA runs, for example this one:

https://openqa.opensuse.org/tests/4038465#step/rspec_webui_tests/11
  • Loading branch information
danidoni committed Mar 26, 2024
1 parent 49f5b6a commit b7d187c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
8 changes: 1 addition & 7 deletions .rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
# on 2024-03-04 14:13:59 UTC using RuboCop version 1.61.0.
# on 2024-03-26 08:59:27 UTC using RuboCop version 1.62.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -24,12 +24,6 @@ Lint/AssignmentInCondition:
Exclude:
- 'dist/clouduploader.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/DeprecatedClassMethods:
Exclude:
- 'dist/t/spec/support/capybara.rb'

# Offense count: 2
Lint/RescueException:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion dist/t/spec/support/capybara.rb
Expand Up @@ -24,7 +24,7 @@

# Set hostname
begin
hostname = Socket.gethostbyname(Socket.gethostname).first
hostname = Addrinfo.getaddrinfo(Socket.gethostname, 443, nil, :STREAM).first.getnameinfo[0]
rescue SocketError
hostname = ''
end
Expand Down
27 changes: 13 additions & 14 deletions src/api/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
# on 2024-03-18 14:23:06 UTC using RuboCop version 1.62.1.
# on 2024-03-26 09:01:51 UTC using RuboCop version 1.62.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -61,8 +61,7 @@ FactoryBot/ExcessiveCreateList:
Exclude:
- 'spec/controllers/webui/monitor_controller_spec.rb'


# Offense count: 24
# Offense count: 25
# Configuration parameters: Include.
# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb
FactoryBot/FactoryAssociationWithStrategy:
Expand All @@ -84,7 +83,7 @@ FactoryBot/FactoryAssociationWithStrategy:
- 'spec/factories/watched_items.rb'
- 'spec/factories/workflow_runs.rb'

# Offense count: 3302
# Offense count: 3286
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Expand Down Expand Up @@ -178,7 +177,7 @@ Lint/UselessMethodDefinition:
- 'app/controllers/webui/requests/submissions_controller.rb'
- 'test/test_helper.rb'

# Offense count: 901
# Offense count: 903
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 255
Expand All @@ -196,7 +195,7 @@ Metrics/BlockNesting:
- 'app/models/bs_request_action.rb'
- 'lib/xpath_engine.rb'

# Offense count: 86
# Offense count: 87
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
Expand Down Expand Up @@ -288,7 +287,7 @@ Metrics/ClassLength:
- 'test/unit/publish_flag_test.rb'
- 'test/unit/user_test.rb'

# Offense count: 188
# Offense count: 189
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/CyclomaticComplexity:
Exclude:
Expand Down Expand Up @@ -379,7 +378,7 @@ Metrics/CyclomaticComplexity:
- 'test/functional/zzz_post_consistency_test.rb'
- 'test/node_matcher.rb'

# Offense count: 986
# Offense count: 987
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 221
Expand Down Expand Up @@ -412,7 +411,7 @@ Metrics/ParameterLists:
- 'test/functional/read_permission_test.rb'
- 'test/functional/source_controller_test.rb'

# Offense count: 160
# Offense count: 161
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/PerceivedComplexity:
Exclude:
Expand Down Expand Up @@ -660,7 +659,7 @@ RSpec/AnyInstance:
- 'spec/models/project_spec.rb'
- 'spec/policies/package_policy_spec.rb'

# Offense count: 1288
# Offense count: 1285
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand Down Expand Up @@ -785,7 +784,7 @@ RSpec/MessageSpies:
- 'spec/controllers/webui/apidocs_controller_spec.rb'
- 'spec/models/kiwi/image_spec.rb'

# Offense count: 1650
# Offense count: 1653
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 28
Expand Down Expand Up @@ -1081,7 +1080,7 @@ Style/ConditionalAssignment:
Exclude:
- 'app/models/bs_request_action_submit.rb'

# Offense count: 1068
# Offense count: 1070
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false
Expand All @@ -1093,7 +1092,7 @@ Style/ExplicitBlockArgument:
- 'app/lib/backend/connection.rb'
- 'app/models/project.rb'

# Offense count: 1840
# Offense count: 1841
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Expand All @@ -1113,7 +1112,7 @@ Style/IdenticalConditionalBranches:
- 'app/controllers/build_controller.rb'
- 'app/controllers/webui/search_controller.rb'

# Offense count: 309
# Offense count: 305
# This cop supports safe autocorrection (--autocorrect).
Style/IfUnlessModifier:
Enabled: false
Expand Down

0 comments on commit b7d187c

Please sign in to comment.