standardrb/standard

standard_test.rb and block_single_line_braces_test.rb test failures

Apteryks opened this issue · 4 comments

Hi,

While updating this package for GNU Guix, I tried enabling the test suite, and saw the following errors:

starting phase `check'
Run options: --seed 14187

# Running:

........................EEEEE.................................................................F....

Finished in 7.656766s, 12.9297 runs/s, 22.7250 assertions/s.

  1) Error:
RuboCop::Cop::Standard::BlockSingleLineBracesTest#test_braces_with_rescue_does_not_fail:
NoMethodError: undefined method `for_cop' for nil:NilClass
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/registry.rb:200:in `enabled?'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:163:in `block in roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `select'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:88:in `investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:196:in `_investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:91:in `assert_no_offense'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/standard/cop/block_single_line_braces_test.rb:48:in `test_braces_with_rescue_does_not_fail'

  2) Error:
RuboCop::Cop::Standard::BlockSingleLineBracesTest#test_multiline_with_do_end:
NoMethodError: undefined method `for_cop' for nil:NilClass
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/registry.rb:200:in `enabled?'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:163:in `block in roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `select'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:88:in `investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:196:in `_investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:91:in `assert_no_offense'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/standard/cop/block_single_line_braces_test.rb:40:in `test_multiline_with_do_end'

  3) Error:
RuboCop::Cop::Standard::BlockSingleLineBracesTest#test_single_line_with_do_end:
NoMethodError: undefined method `for_cop' for nil:NilClass
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/registry.rb:200:in `enabled?'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:163:in `block in roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `select'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:88:in `investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:196:in `_investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:30:in `assert_offense'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/standard/cop/block_single_line_braces_test.rb:21:in `test_single_line_with_do_end'

  4) Error:
RuboCop::Cop::Standard::BlockSingleLineBracesTest#test_single_line_with_braces:
NoMethodError: undefined method `for_cop' for nil:NilClass
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/registry.rb:200:in `enabled?'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:163:in `block in roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `select'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:88:in `investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:196:in `_investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:91:in `assert_no_offense'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/standard/cop/block_single_line_braces_test.rb:15:in `test_single_line_with_braces'

  5) Error:
RuboCop::Cop::Standard::BlockSingleLineBracesTest#test_multiline_with_braces:
NoMethodError: undefined method `for_cop' for nil:NilClass
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/registry.rb:200:in `enabled?'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:163:in `block in roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `select'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:161:in `roundup_relevant_cops'
    /gnu/store/vj74f2pg318vcvnr3x6x0rcsqmxmq8cr-ruby-rubocop-1.47.0/lib/ruby/vendor_ruby/gems/rubocop-1.47.0/lib/rubocop/cop/team.rb:88:in `investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:196:in `_investigate'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/cop_invoker.rb:91:in `assert_no_offense'
    /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/standard/cop/block_single_line_braces_test.rb:32:in `test_multiline_with_braces'

  6) Failure:
StandardTest#test_configured_all_cops [/tmp/guix-build-ruby-standard-1.24.3.drv-0/source/test/standard_test.rb:32]:
config/base.yml has been rewritten to add missing cops, review and commit it

99 runs, 174 assertions, 1 failures, 5 errors, 0 skips
Coverage report generated for Unit Tests to /tmp/guix-build-ruby-standard-1.24.3.drv-0/source/coverage. 1154 / 1226 LOC (94.13%) covered.
rake aborted!
Command failed with status (1)

Tasks: TOP => test
(See full trace by running task with --trace)
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "rake" arguments: ("test") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `check' failed after 8.8 seconds
command "rake" "test" failed with status 1

The direct dependencies used are:

ruby-gimme@0.5.0-1.4e71f02 ruby-language-server-protocol@3.17.0.2 ruby-pry@0.13.1
+ ruby-rubocop-performance@1.16.0 ruby-rubocop@1.47.0 ruby-simplecov@0.22.0

I could workaround the failures by deleting the test/standard_test.rb and test/standard/cop/block_single_line_braces_test.rb files before running the test.

Thanks!

Hi @Apteryks -- Standard locks to a specific version of rubocop, currently 1.44.1, so I would not expect it to work against 1.47.0 until we've tested and cut a release.

I see! Then I guess it can be closed; if I have time I'll try it against 1.44.1 to verify this was indeed the problem. Thanks!

Thanks. We will update our dependencies soon. We're on a monthly cadence to update them