rails / jbuilder

Jbuilder: generate JSON objects with a Builder-style DSL
MIT License
4.34k stars 438 forks source link

JBuilder Template Test failing on CI #540

Closed stefannibrasil closed 2 years ago

stefannibrasil commented 2 years ago

The CI is returning the following error for Ruby >= 2.7:

Failure:
JbuilderTemplateTest#test_array_of_partials [/home/runner/work/jbuilder/jbuilder/test/jbuilder_template_test.rb:103]:
Expected: "Post #5"
  Actual: nil

rails test home/runner/work/jbuilder/jbuilder/test/jbuilder_template_test.rb:100

The CI is failing even when no code changes were made. I don't have a lot of context about JBuilder and can't provide more details. I hope opening an Issue is okay. Thanks!

hahmed commented 2 years ago

Thanks @stefannibrasil for reporting this issue. The issue relates to upstream rails, a change on that end caused jbuilder to break.

I did a git bisect and it looks related to the changes in https://github.com/rails/rails/pull/45614/

stefannibrasil commented 2 years ago

hi @hahmed thank you for doing that! I'm not sure what would be the next step. Perhaps creating an issue on Rails? Thank you!

hahmed commented 2 years ago

So it looks like the rails commit is something we want to keep, which means jbuilder tests will need fixing.

I tested jbuilder in an app and it looks to be working fine, it's only the tests. Specifically the way it's setup to use ActionView.

casperisfine commented 2 years ago

So https://github.com/rails/rails/pull/46298 makes the jbuilder test suite pass on rails_head.

I'm waiting to see if it doesn't break anything on the Rails side though. The Action View test suite passes, but that doesn't mean a lot.

stefannibrasil commented 2 years ago

thank you, @casperisfine 🎉