Skip to content

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

Description

@tbrisker

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

Activity

  1. added a commit that references this issue on Jul 8, 2021
  2. added a commit that references this issue on Jul 8, 2021
  3. hsbt commented on Jul 8, 2021

    @hsbt
    Member

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

  4. ekohl commented on Jul 8, 2021

    @ekohl

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

  5. tbrisker commented on Jul 8, 2021

    @tbrisker
    ContributorAuthor

    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!
    
  6. hsbt commented on Jul 8, 2021

    @hsbt
    Member

    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
    
  7. reopened this on Jul 8, 2021
  8. tbrisker commented on Jul 8, 2021

    @tbrisker
    ContributorAuthor

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

  9. ehelms commented on Jul 8, 2021

    @ehelms

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

  10. hsbt commented on Jul 9, 2021

    @hsbt
    Member

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions