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

standard_test.rb and block_single_line_braces_test.rb test failures #532

Open
Apteryks opened this issue Mar 2, 2023 · 4 comments
Open

Comments

@Apteryks
Copy link

Apteryks commented Mar 2, 2023

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:

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!

@searls
Copy link
Contributor

searls commented Mar 5, 2023

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.

@Apteryks
Copy link
Author

Apteryks commented Mar 6, 2023

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!

@searls
Copy link
Contributor

searls commented Mar 6, 2023

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

@pboling
Copy link
Contributor

pboling commented Jul 7, 2023

Related: standardrb/standard-custom#4

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

No branches or pull requests

3 participants