Bug 1869719 - Review Request: rubygem-image_processing - High-level wrapper for processing images for the web with ImageMagick or libvips
Summary: Review Request: rubygem-image_processing - High-level wrapper for processing ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jaroslav Prokop
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-18 13:44 UTC by Pavel Valena
Modified: 2020-10-30 01:56 UTC (History)
3 users (show)

Fixed In Version: rubygem-image_processing-1.11.0-1.fc34 rubygem-image_processing-1.11.0-1.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-30 01:56:36 UTC
Type: ---
Embargoed:
jar.prokop: fedora-review+


Attachments (Terms of Use)

Comment 1 Jaroslav Prokop 2020-08-18 14:31:43 UTC
I'll take this for a review.

Comment 2 Jaroslav Prokop 2020-08-18 15:03:24 UTC
Looks fine, I just have 2 nits:

There is some documentation in `doc` directory in the image_processing project that I think should be included since it looks like it has more content than the generated docs.
Maybe transform it into some kind of manpage or include it in the *-doc subpackage?

And just a triviality:
This `%{gem_instdir}/image_processing.gemspec` could use a macro so it becomes `%{gem_instdir}/%{gem_name}.gemspec`.

Comment 3 Vít Ondruch 2020-08-19 14:27:03 UTC
* Unversioned `%gemspec_remove`
  - I don't like the usage of `%gemspec_remove` without specifying versions.
    If I am not mistaken, when the dependency is removed upstream, then it
    would pass without noticing. It is not really big deal, but it is nice
    to know there is something to remove if it is not needed anymore.

* `skip` vs `return`
  - It probably won't make any real difference, but wouldn't it be better to
    use `sed -i '/Vips::/ i \  return' test/test_helper.rb` instead of
    `sed -i '/Vips::/ i \  skip' test/test_helper.rb`?

Comment 4 Vít Ondruch 2020-08-19 14:28:36 UTC
(In reply to Jaroslav Prokop from comment #2)
> Looks fine

You have probably forgot fedora-review+?

Comment 5 Jaroslav Prokop 2020-08-19 16:22:36 UTC
Yeah right,(In reply to Vít Ondruch from comment #4)
> You have probably forgot fedora-review+?

Right, package approved!

Comment 6 Pavel Valena 2020-08-20 22:04:59 UTC
Thank you both for your reviews!

I've added %bcond_with to disable the tests once ruby-vips is in Fedora (the test suite suceeds without skips).


> There is some documentation in `doc` directory in the image_processing project that I think should be included since it looks like it has more content than the generated docs.

Oh, you mean the upstream `doc` directory. Well, feel free to create a PR to add documentation into the gem (either generated, like other gems, or just the *.md files; that's up to the upstream).

> This `%{gem_instdir}/image_processing.gemspec` could use a macro so it becomes `%{gem_instdir}/%{gem_name}.gemspec`.

Sure, can be both ways (updated).

_ _ _ _


> * `skip` vs `return`

To me, the benefit of `skip` is that I see "SSSSSSSSS" in the test output, so I know the tests are skipped actually. `return` would just hide the issue, right?

> * Unversioned `%gemspec_remove`

It fails actually: https://gist.github.com/pvalena/aeda48c6fa786f2f3d41f996c3a6c11a

An like I wrote previously, I'll not be running %gemspec_remove anyway, once ruby-vips is in Fedora.

Comment 7 Gwyn Ciesla 2020-08-20 22:29:28 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/rubygem-image_processing

Comment 8 Vít Ondruch 2020-08-24 11:56:13 UTC
(In reply to Pavel Valena from comment #6)
> > * `skip` vs `return`
> 
> To me, the benefit of `skip` is that I see "SSSSSSSSS" in the test output,
> so I know the tests are skipped actually. `return` would just hide the
> issue, right?

That is nice of course, but if the test case contains more asserts, the `skip` won't execute the following asserts, while the `return` does. So what are pros/cons? :)

Comment 9 Pavel Valena 2020-09-23 12:09:31 UTC
""" the `skip` won't execute the following asserts """

Are you sure about that? I've always thought it's the other way around:

```
# SKIP:
DEBUG: # Running:
DEBUG: SSSSSSSSSSSSSSS..S.SSSSSSSS.....S..S...SSS..SSS...S.SS..S..S..................S.S...S.S.
DEBUG: Finished in 3.638647s, 24.1848 runs/s, 20.3372 assertions/s.
DEBUG: 88 runs, 74 assertions, 0 failures, 0 errors, 41 skips

# RETURN:
DEBUG: + ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
DEBUG: Run options: --seed 39129
DEBUG: # Running:
DEBUG: ........................................................................................
DEBUG: Finished in 4.193257s, 20.9861 runs/s, 19.5552 assertions/s.
DEBUG: 88 runs, 82 assertions, 0 failures, 0 errors, 0 skips
```

And with the same test-set, but vips enabled:

```
DEBUG: Run options: --seed 32767
DEBUG: # Running:
DEBUG: ........................................................................................
DEBUG: Finished in 5.651056s, 15.5723 runs/s, 26.5437 assertions/s.
DEBUG: 88 runs, 150 assertions, 0 failures, 0 errors, 0 skips
```

aaand ... now I'm even more confused. So the return has (8) more assertions, and `skip` does not count show all assertions skipped (return hides those, obviously)?

Comment 10 Vít Ondruch 2020-09-23 12:47:55 UTC
(In reply to Pavel Valena from comment #9)
> """ the `skip` won't execute the following asserts """

The `skip` or `return` are placed into custom assertion if I am not mistaken. `skip` raises exception, so effectively fails the whole test case, while `return` just exits the specific assertion and let the following assert do its job.


Note You need to log in before you can comment on or make changes to this bug.