Skip to content

Relax assertion pattern for ruby repo #781

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

Closed
wants to merge 1 commit into from

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Mar 28, 2025

test_deprecated_load_create_additions is failing on ruby/ruby repo(ruby/ruby#13004):

  1) Failure:
JSONAdditionTest#test_deprecated_load_create_additions [/Users/hsbt/Documents/github.com/ruby/ruby/test/json/json_addition_test.rb:159]:
expected: /json_addition_test\.rb.*use JSON\.unsafe_load/
actual: "/Users/hsbt/Documents/github.com/ruby/ruby/.ext/common/json/common.rb:860: warning: JSON.load implicit support for `create_additions: true` is deprecated and will be removed in 3.0, use JSON.unsafe_load or explicitly pass `create_additions: true`\n".

I'm not sure this fix is good for this test. @byroot Could you review this?

@@ -152,7 +152,7 @@ def test_core

def test_deprecated_load_create_additions
pattern = /json_addition_test\.rb.*use JSON\.unsafe_load/
if RUBY_ENGINE == 'truffleruby'
if RUBY_ENGINE == 'truffleruby' || File.basename($0) != 'json_addition_test.rb'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is correct, because even in this repo, when we run bundle exec rake I don't think $0 is json_addtion_test.rb.

Can you show me a failure from ruby/ruby? The PR you pointed seem to have passed fine.

@byroot
Copy link
Member

byroot commented Mar 28, 2025

I just tested it's "rake_test_loader.rb" as I suspected.

@byroot
Copy link
Member

byroot commented Mar 28, 2025

I can just remove that part of the test.

@byroot byroot closed this in 0d4fc66 Mar 28, 2025
@byroot byroot deleted the forward-port-from-ruby-master branch March 28, 2025 07:54
matzbot pushed a commit to ruby/ruby that referenced this pull request Mar 31, 2025
Fix: ruby/json#781

Tests are ran a bit differently in ruby/ruby
and this assertion breaks.

ruby/json@0d4fc669ed
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

Successfully merging this pull request may close these issues.

2 participants