Address `ActiveStorage::VariantTest#test_resized_variation_of_WEBP_blob` failure at Rails Nightly CI

Managed to reproduce Rails Nightly CI failure
at https://buildkite.com/rails/rails-nightly/builds/149#018d9052-1b2d-48fa-9d74-a39df3f3f1d6/1251-1291

This commit allows both 33 and 34 as its height because this issue is isolated
that thedifference comes from libvips and/or ruby-vips behavior differences, not Active Storage.

* Steps to reprodude
Run this test on Ubuntu 22.04. It should not reproduce on Ubuntu 23.10.

```
git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
cd activestorage
bin/test test/models/variant_test.rb -n test_resized_variation_of_WEBP_blob
```

* Expected behavior
It should pass.

* Actual behavior
It fails because the height of the thumbnail is 34.

```
$ bin/test test/models/variant_test.rb -n test_resized_variation_of_WEBP_blob
F

Failure:
ActiveStorage::VariantTest#test_resized_variation_of_WEBP_blob [test/models/variant_test.rb:125]:
Expected: 33
  Actual: 34

bin/test test/models/variant_test.rb:117
```

Refer to https://github.com/libvips/ruby-vips/issues/383
This commit is contained in:
Yasuo Honda 2024-02-13 20:37:50 +09:00
parent a42ca9cf14
commit 034398fdfe
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
image = read_image(variant)
assert_equal "WEBP", image.type
assert_equal 50, image.width
assert_equal 33, image.height
assert_includes [33, 34], image.height
end
test "optimized variation of GIF blob" do