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

Rake test fails to run with uninitialized constant FileList (NameError) #388

Closed
tbrisker opened this issue Jul 7, 2021 · 7 comments · Fixed by #389 or #390
Closed

Rake test fails to run with uninitialized constant FileList (NameError) #388

tbrisker opened this issue Jul 7, 2021 · 7 comments · Fixed by #389 or #390

Comments

@tbrisker
Copy link
Contributor

tbrisker commented Jul 7, 2021

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

hsbt added a commit that referenced this issue Jul 8, 2021
@hsbt hsbt closed this as completed in #389 Jul 8, 2021
hsbt added a commit that referenced this issue Jul 8, 2021
@hsbt
Copy link
Member

hsbt commented Jul 8, 2021

@tbrisker Just released rake-13.0.5. Can you try it?

@ekohl
Copy link

ekohl commented Jul 8, 2021

I've submitted theforeman/foreman#8650 so we'll see what CI says.

@tbrisker
Copy link
Contributor Author

tbrisker commented Jul 8, 2021

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!

@hsbt
Copy link
Member

hsbt commented Jul 8, 2021

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

@hsbt hsbt reopened this Jul 8, 2021
@tbrisker
Copy link
Contributor Author

tbrisker commented Jul 8, 2021

@hsbt Thank you for the quick response. looks like that indeed fixes the issue.

@ehelms
Copy link

ehelms commented Jul 8, 2021

Thanks @hsbt , I tested in our environment and that fixed the issue for https://github.com/theforeman

@hsbt
Copy link
Member

hsbt commented Jul 9, 2021

@tbrisker Thanks! I released rake-13.0.6 with the above fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants