Rake test fails to run with uninitialized constant FileList (NameError)
tbrisker opened this issue · comments
Tomer Brisker commented
Since the 13.0.4 release all our tests are failing to run:
[2021-07-07T12:31:48.957Z] ** Execute test:katello:spec
[2021-07-07T12:31:48.957Z] ** Invoke katello_spec_task (first_time)
[2021-07-07T12:31:48.957Z] ** Execute katello_spec_task
[2021-07-07T12:31:48.957Z] /usr/local/rvm/rubies/ruby-2.7.0/bin/ruby -I"lib:test:/home/jenkins/workspace/katello-pr-test/test:spec:/home/jenkins/workspace/katello-pr-test/spec" /usr/local/rvm/gems/ruby-2.7.0@katello-pr-test-7573-1/gems/rake-13.0.4/lib/rake/rake_test_loader.rb "/home/jenkins/workspace/katello-pr-test/spec/**/*_spec.rb" -v --ci-reporter
[2021-07-07T12:31:49.528Z] /usr/local/rvm/gems/ruby-2.7.0@katello-pr-test-7573-1/gems/rake-13.0.4/lib/rake/rake_test_loader.rb:9:in `block in <main>': uninitialized constant FileList (NameError)
[2021-07-07T12:31:49.528Z] Did you mean? FileTest
[2021-07-07T12:31:49.528Z] from /usr/local/rvm/gems/ruby-2.7.0@katello-pr-test-7573-1/gems/rake-13.0.4/lib/rake/rake_test_loader.rb:4:in `select'
[2021-07-07T12:31:49.528Z] from /usr/local/rvm/gems/ruby-2.7.0@katello-pr-test-7573-1/gems/rake-13.0.4/lib/rake/rake_test_loader.rb:4:in `<main>'
[2021-07-07T12:31:49.528Z] rake aborted!
Not sure, but this might be related to #379
Hiroshi SHIBATA commented
@tbrisker Just released rake-13.0.5. Can you try it?
Ewoud Kohl van Wijngaarden commented
I've submitted theforeman/foreman#8650 so we'll see what CI says.
Tomer Brisker commented
Unfortunately it seems to still be broken in 13.0.5 as well:
/usr/local/rvm/gems/ruby-2.5.1@test_develop_pr_katello-0/gems/rake-13.0.5/lib/rake/rake_test_loader.rb:11:in `block in <main>': uninitialized constant FileList (NameError)
Did you mean? FileTest
from /usr/local/rvm/gems/ruby-2.5.1@test_develop_pr_katello-0/gems/rake-13.0.5/lib/rake/rake_test_loader.rb:6:in `select'
from /usr/local/rvm/gems/ruby-2.5.1@test_develop_pr_katello-0/gems/rake-13.0.5/lib/rake/rake_test_loader.rb:6:in `<main>'
rake aborted!
Hiroshi SHIBATA commented
Ah, Can you try the following patch?
From 971c873c6cd58f8e6b37284aaf3a0c8d09340509 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Date: Thu, 8 Jul 2021 20:45:08 +0900
Subject: [PATCH] Added Rake namespace explicitly
---
lib/rake/rake_test_loader.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git lib/rake/rake_test_loader.rb lib/rake/rake_test_loader.rb
index af4a182..3ecee5d 100644
--- lib/rake/rake_test_loader.rb
+++ lib/rake/rake_test_loader.rb
@@ -8,7 +8,7 @@
when /^-/ then
argument
when /\*/ then
- FileList[argument].to_a.each do |file|
+ Rake::FileList[argument].to_a.each do |file|
require File.expand_path file
end
--
2.32.0
Tomer Brisker commented
@hsbt Thank you for the quick response. looks like that indeed fixes the issue.
Eric Helms commented
Thanks @hsbt , I tested in our environment and that fixed the issue for https://github.com/theforeman
Hiroshi SHIBATA commented
@tbrisker Thanks! I released rake-13.0.6 with the above fix.