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

Run tests with warnings enabled #1462

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

Earlopain
Copy link
Collaborator

format doesn't accept an array. This currently creates a format constraint that looks like this,
and emits a warning because characters appear multiple times in the character class:
/\A["css", "js", "svg"]\Z/

The constraint is actually not needed, the controller already handles this. Tests for this are already present.


A few test methods are redefined for jruby reasons. That doesn't actually run in CI right now so I'm not sure if this interferes with that, internally silence_redefinition_of_method does some aliasing.

`format` doesn't accept an array. This currently creates a format constraint that looks like this,
and emits a warning because characters appear multiple times in the character class:
`/\A["css", "js", "svg"]\Z/`

The constraint is actually not needed, the controller already handles this.
@bensheldon bensheldon added the refactor Code changes that do not introduce new features label Aug 9, 2024
@bensheldon
Copy link
Owner

Thank you 🙇🏻 I can merge this and then we'll have to address any warning with JRuby builds when #1390 is fixed.

@bensheldon
Copy link
Owner

These are JRuby warnings locally:

/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/stdlib/ostruct.rb:466: warning: OpenStruct#public_send accesses caller method's state and should not be aliased
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/stdlib/ostruct.rb:466: warning: OpenStruct#method accesses caller method's state and should not be aliased
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/stdlib/date.rb:471: warning: previous definition of strptime was here
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/stdlib/date.rb:490: warning: previous definition of parse was here
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/stdlib/date.rb:737: warning: previous definition of parse was here
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb:13: warning: method redefined; discarding old to_int
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb:13: warning: method redefined; discarding old to_f
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/mail-2.8.1/lib/mail/parsers/date_time_parser.rb:837: warning: statement not reached
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/mail-2.8.1/lib/mail/parsers/date_time_parser.rb:691: warning: assigned but unused variable - testEof
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/mail-2.8.1/lib/mail/parsers/address_lists_parser.rb:32457: warning: statement not reached
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/mail-2.8.1/lib/mail/parsers/address_lists_parser.rb:32743: warning: statement not reached
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/mail-2.8.1/lib/mail/parsers/address_lists_parser.rb:32759: warning: statement not reached
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/mail-2.8.1/lib/mail/parsers/address_lists_parser.rb:32866: warning: statement not reached
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/mail-2.8.1/lib/mail/parsers/address_lists_parser.rb:31987: warning: assigned but unused variable - testEof
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/nokogiri-1.16.7-java/lib/nokogiri/xml/node.rb:1007: warning: method redefined; discarding old attr
/Users/bensheldon/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/activerecord-7.1.3.4/lib/active_record/model_schema.rb:167: warning: previous definition of inheritance_column= was here
failed to load native console support: native console on MacOS only supported on i386, x86_64
io/console on JRuby shells out to stty for most operations
Excluding System Tests in JRuby

@bensheldon bensheldon merged commit a61fc09 into bensheldon:main Aug 9, 2024
10 checks passed
@Earlopain Earlopain deleted the tests-with-warnings branch August 9, 2024 15:50
@Earlopain
Copy link
Collaborator Author

The mail gem warnings are legit and you can't do anything about those (PR pending for a while now), happen with cruby as well. Thought for some reason I didn't get them locally.

If you do get them, you can partially copy what rails does with its StrictWarnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code changes that do not introduce new features
Projects
Development

Successfully merging this pull request may close these issues.

2 participants