Skip to content

Commit

Permalink
QE: Update Ruby to version 3.3
Browse files Browse the repository at this point in the history
Fixes SUSE/spacewalk#17431

Signed-off-by: Dominik Gedon <dominik.gedon@suse.com>
  • Loading branch information
nodeg committed Aug 19, 2024
1 parent 67d2d57 commit f84f6a4
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 23 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,11 @@ jobs:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.5'
ruby-version: '3.3'

- name: Install Rubocop
run: |
gem install parallel -v 1.10
gem install parser -v 3.0.0.0
gem install rainbow -v 2.2.2
gem install regexp_parser -v 1.8
gem install rexml
gem install rubocop-ast -v 1.7.0
gem install ruby-progressbar -v 1.7
gem install unicode-display_width -v 1.4.0
gem install rubocop -v 1.17.0
gem install rubocop -v 1.65.1
- name: Run RuboCop
run: |
Expand Down
2 changes: 1 addition & 1 deletion testsuite/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ inherit_from: .rubocop_todo.yml
AllCops:
EnabledByDefault: true
SuggestExtensions: false
TargetRubyVersion: 2.5
TargetRubyVersion: 3.3

Style/MissingElse:
Enabled: false
Expand Down
233 changes: 225 additions & 8 deletions testsuite/.rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,158 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-11-17 13:57:32 UTC using RuboCop version 1.17.0.
# on 2024-08-19 12:51:03 UTC using RuboCop version 1.65.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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 31
# Configuration parameters: RequireForNonPublicMethods.
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'Rakefile'

# Offense count: 26
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Layout/LineContinuationLeadingSpace:
Exclude:
- 'features/step_definitions/command_steps.rb'
- 'features/step_definitions/vm_steps.rb'
- 'features/support/kubernetes.rb'

# Offense count: 19
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
Layout/LineContinuationSpacing:
Exclude:
- 'features/support/kubernetes.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/LineEndStringConcatenationIndentation:
Exclude:
- 'features/step_definitions/command_steps.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/SpaceAfterComma:
Exclude:
- 'Rakefile'

# Offense count: 1
# Configuration parameters: DebuggerMethods, DebuggerRequires.
Lint/Debugger:
Exclude:
- 'features/step_definitions/common_steps.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/RedundantRequireStatement:
Exclude:
- 'features/step_definitions/command_steps.rb'
- 'features/support/cobbler_test.rb'
- 'features/support/env.rb'

# Offense count: 1
# Configuration parameters: LengthThreshold.
Metrics/CollectionLiteralLength:
Exclude:
- 'features/support/constants.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, BlockForwardingName.
# SupportedStyles: anonymous, explicit
Naming/BlockForwarding:
Exclude:
- 'features/support/commonlib.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, conditionals
Style/AndOr:
Exclude:
- 'Rakefile'

# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
# RedundantRestArgumentNames: args, arguments
# RedundantKeywordRestArgumentNames: kwargs, options, opts
# RedundantBlockArgumentNames: blk, block, proc
Style/ArgumentsForwarding:
Exclude:
- 'features/support/commonlib.rb'

# Offense count: 48
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/ArrayFirstLast:
Exclude:
- 'ext-tools/collect_and_tag_flaky_tests.rb'
- 'ext-tools/maintenance_crawler.rb'
- 'features/step_definitions/api_common.rb'
- 'features/step_definitions/command_steps.rb'
- 'features/step_definitions/common_steps.rb'
- 'features/step_definitions/docker_steps.rb'
- 'features/step_definitions/salt_steps.rb'
- 'features/step_definitions/setup_steps.rb'
- 'features/step_definitions/smdba_steps.rb'
- 'features/step_definitions/vm_steps.rb'
- 'features/support/commonlib.rb'
- 'features/support/http_client.rb'
- 'features/support/namespaces/api.rb'
- 'features/support/twopence_init.rb'

# Offense count: 2
# Configuration parameters: AllowedMethods, RequireForNonPublicMethods.
Style/DocumentationMethod:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'features/support/commonlib.rb'
- 'features/support/twopence_init.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: Thread.current
Style/HashEachMethods:
Exclude:
- 'Rakefile'
- 'features/step_definitions/command_steps.rb'
- 'features/step_definitions/setup_steps.rb'

# Offense count: 91
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
# SupportedShorthandSyntax: always, never, either, consistent, either_consistent
Style/HashSyntax:
Exclude:
- 'ext-tools/collect_and_tag_flaky_tests.rb'
- 'features/step_definitions/command_steps.rb'
- 'features/step_definitions/docker_steps.rb'
- 'features/step_definitions/navigation_steps.rb'
- 'features/step_definitions/setup_steps.rb'
- 'features/support/commonlib.rb'
- 'features/support/lavanda.rb'
- 'features/support/namespaces/actionchain.rb'
- 'features/support/namespaces/activationkey.rb'
- 'features/support/namespaces/channel.rb'
- 'features/support/namespaces/configchannel.rb'
- 'features/support/namespaces/image.rb'
- 'features/support/namespaces/kickstart.rb'
- 'features/support/namespaces/system.rb'
- 'features/support/twopence_init.rb'
- 'features/support/namespaces/user.rb'

# Offense count: 16
# Cop supports --auto-correct.
# Offense count: 20
# This cop supports safe autocorrection (--autocorrect).
Style/IfUnlessModifier:
Exclude:
- 'features/step_definitions/cobbler_steps.rb'
Expand All @@ -32,9 +165,17 @@ Style/IfUnlessModifier:
- 'features/step_definitions/vm_steps.rb'
- 'features/support/http_client.rb'

Style/InlineComment:
# Offense count: 76
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: InverseMethods.
Style/InvertibleUnlessCondition:
Enabled: false

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapIntoArray:
Exclude:
- 'features/support/constants.rb'
- 'features/support/cobbler_test.rb'

# Offense count: 7
# Configuration parameters: AllowedMethods.
Expand All @@ -46,9 +187,85 @@ Style/OptionalBooleanParameter:
- 'features/support/http_client.rb'
- 'features/support/lavanda.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantFilterChain:
Exclude:
- 'features/step_definitions/api_common.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantParentheses:
Exclude:
- 'features/step_definitions/retail_steps.rb'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpArgument:
Exclude:
- 'features/step_definitions/command_steps.rb'
- 'features/step_definitions/salt_steps.rb'
- 'features/support/lavanda.rb'

# Offense count: 25
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantStringEscape:
Exclude:
- 'features/step_definitions/cobbler_steps.rb'
- 'features/step_definitions/command_steps.rb'
- 'features/step_definitions/file_management_steps.rb'
- 'features/step_definitions/smdba_steps.rb'
- 'features/step_definitions/vm_steps.rb'

# Offense count: 35
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RequireOrder:
Exclude:
- 'Rakefile'
- 'ext-tools/collect_and_tag_flaky_tests.rb'
- 'ext-tools/maintenance_crawler.rb'
- 'features/step_definitions/command_steps.rb'
- 'features/step_definitions/common_steps.rb'
- 'features/step_definitions/docker_steps.rb'
- 'features/step_definitions/salt_steps.rb'
- 'features/step_definitions/security_steps.rb'
- 'features/support/api_test.rb'
- 'features/support/cobbler_test.rb'
- 'features/support/code_coverage.rb'
- 'features/support/commonlib.rb'
- 'features/support/env.rb'
- 'features/support/lavanda.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SelectByRegexp:
Exclude:
- 'features/step_definitions/api_common.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/SuperArguments:
Exclude:
- 'features/support/custom_formatter.rb'

# Offense count: 1
# Configuration parameters: EnforcedStyle.
# SupportedStyles: forbid_mixed_logical_operators, forbid_logical_operators
Style/UnlessLogicalOperators:
Exclude:
- 'features/step_definitions/vm_steps.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/YAMLFileRead:
Exclude:
- 'Rakefile'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: .
# SupportedOperators: *, +, &, |, ^
Style/YodaExpression:
Exclude:
- 'features/support/commonlib.rb'
- 'features/support/env.rb'
2 changes: 1 addition & 1 deletion testsuite/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gem 'rake', '~> 13.2'
gem 'redis', '~> 5.2'
gem 'redis-client', '~> 0.22'
gem 'require_all', '~> 3.0'
# gem 'rubocop', '1.17.0'
gem 'rubocop', '1.65.1'
gem 'selenium-webdriver', '4.23.0'
gem 'simplecov', '~> 0.22'
gem 'syntax', '~> 1.2'
Expand Down
6 changes: 4 additions & 2 deletions testsuite/dockerfiles/controller-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ CMD ssh-keygen -A && /usr/sbin/sshd -De

### Ruby 3 changes ###
RUN export GEM_PATH="/usr/lib64/ruby/gems/3.3.0"
RUN echo 'GEM_PATH="/usr/lib64/ruby/gems/3.3.0"' >> ./root/.bashrc

RUN ln -sf /usr/bin/ruby.ruby3.3 /usr/bin/ruby
RUN ln -sf /usr/bin/gem.ruby3.3 /usr/bin/gem
Expand All @@ -62,7 +63,8 @@ RUN git clone https://github.com/nodeg/twopence.git /root/twopence && \
cd /root/twopence && \
git checkout update_ruby && \
make && \
make install && \
gem list
make install
RUN gem list | grep twopence
RUN file /usr/lib64/ruby/gems/3.3.0/gems/twopence-0.4.2/lib/twopence.so

RUN curl https://raw.githubusercontent.com/nodeg/uyuni/master/testsuite/Gemfile -o Gemfile && bundle.ruby3.3 install && rm Gemfile
2 changes: 1 addition & 1 deletion testsuite/podman_runner/05_install_gems_in_controller.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -xe
sudo -i podman exec controller bash -c "cd /testsuite && bundle.ruby3.3 install --gemfile Gemfile"
sudo -i podman exec controller bash -c "cd /testsuite && bundle.ruby3.3 install --gemfile Gemfile --verbose"

0 comments on commit f84f6a4

Please sign in to comment.