Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci_reporter_minitest Rakefile dependency for nightly #937

Merged
merged 1 commit into from
May 10, 2024

Conversation

ianballou
Copy link
Member

Adds a requirement to the rake file so it can actually run.

Locally I'm seeing:

vagrant@centos9-katello-devel ~/hammer-cli-katello $ bundle exec rake ci:setup:minitest
WARNING: File locale/de_AT/LC_MESSAGES/hammer-cli-katello.mo outdated, regenerate with 'make all-mo'
WARNING: File locale/ka/LC_MESSAGES/hammer-cli-katello.mo outdated, regenerate with 'make all-mo'
WARNING: File locale/or/LC_MESSAGES/hammer-cli-katello.mo outdated, regenerate with 'make all-mo'
rake aborted!
ArgumentError: wrong number of arguments (given 2, expected 1)
/home/vagrant/hammer-cli-katello/.vendor/ruby/3.0.0/gems/ci_reporter_minitest-1.0.0/lib/ci/reporter/rake/minitest.rb:6:in `block (3 levels) in <top (required)>'
/usr/local/share/gems/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:58:in `load'

which is really odd since it's an rm_rf call that's failing, but it works locally in hammer-cli-foreman. Perhaps it has something to do with my system, but I'm curious if others reproduce the error above too. If they do, then perhaps our CI will as well.

@ianballou
Copy link
Member Author

It looks like the issue has something to do with system fileutil vs bundler file utils:

hammer-cli-foreman

[4] pry(main)> FileUtils.method(:rm_rf).source_location
=> ["/usr/share/ruby/fileutils.rb", 647]

hammer-cli-katello

from /home/vagrant/hammer-cli-katello/.vendor/ruby/3.0.0/gems/fileutils-1.7.2/lib/fileutils.rb:1328:in `rm_rf'

@ianballou
Copy link
Member Author

Weird, even though the source locations are different, the implementation of rm_rf is the same!

  def rm_rf(list, noop: nil, verbose: nil, secure: nil)
    rm_r list, force: true, noop: noop, verbose: verbose, secure: secure
  end
  module_function :rm_rf
  
#vs

  def rm_rf(list, noop: nil, verbose: nil, secure: nil)
    rm_r list, force: true, noop: noop, verbose: verbose, secure: secure
  end
  module_function :rm_rf

@ianballou ianballou force-pushed the fix-nightlies-more branch from 81cf702 to aa102c9 Compare May 9, 2024 14:28
@ianballou
Copy link
Member Author

Interesting...

From: /home/vagrant/hammer-cli-katello/.vendor/ruby/3.0.0/gems/rake-10.5.0/lib/rake/file_utils_ext.rb:122 Rake::FileUtilsExt#rake_merge_option:

    116: def rake_merge_option(args, defaults)
    117:   if Hash === args.last
    118:     defaults.update(args.last)
    119:     args.pop
    120:   end
    121:   args.push defaults
 => 122:   args
    123: end

[3] pry(main)> args
=> ["test/reports", {:verbose=>#<Object:0x00007f2c3c5984d0>, :noop=>false}]

Looks like some args are sneaking in. I think some library here is out of date. fileutils rm_rf used to take an options hash.

@ianballou
Copy link
Member Author

Looks like h-c-f uses a much newer version of Rake:

From: /home/vagrant/hammer-cli-foreman/.vendor/ruby/3.0.0/gems/rake-13.2.1/lib/rake/file_utils_ext.rb:35 Rake::FileUtilsExt#rm_rf:

@ianballou ianballou force-pushed the fix-nightlies-more branch 3 times, most recently from 55a16ca to d4a0132 Compare May 10, 2024 13:40
@ianballou ianballou force-pushed the fix-nightlies-more branch from d4a0132 to 6212f7d Compare May 10, 2024 14:29

Rake::TestTask.new do |t|
t.libs << "lib"
t.test_files = Dir.glob('test/**/*_test.rb')
t.verbose = true
t.warning = false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I turned the warnings off because upgrading Rake caused all sorts of warnings to start popping up, many come from libraries. Example:

/home/vagrant/hammer-cli-katello/.vendor/ruby/2.7.0/gems/clamp-1.3.2/lib/clamp/attribute/instance.rb:23: warning: instance variable @subcommand_arguments not initialize
/home/vagrant/hammer-cli-katello/.vendor/ruby/3.0.0/gems/fast_gettext-2.3.0/lib/fast_gettext/vendor/string.rb:70: warning: too many arguments for format string

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine, rather have green tests than ruby warnings

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, sorry you had to do some rubocop work

@ianballou ianballou merged commit fa5ddc0 into Katello:master May 10, 2024
7 of 10 checks passed
@ianballou ianballou deleted the fix-nightlies-more branch May 10, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants