Bug 2014774 - Review Request: truth - An assertion framework for Java unit tests
Summary: Review Request: truth - An assertion framework for Java unit tests
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Didik Supriadi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: FE-JAVASIG
TreeView+ depends on / blocked
 
Reported: 2021-10-16 16:18 UTC by Orion Poplawski
Modified: 2021-12-13 02:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-13 02:33:15 UTC
Type: Bug
Embargoed:
didiksupriadi41: fedora-review+


Attachments (Terms of Use)

Description Orion Poplawski 2021-10-16 16:18:31 UTC
Spec URL: https://www.cora.nwra.com/~orion/fedora/truth.spec
SRPM URL: https://www.cora.nwra.com/~orion/fedora/truth-0.42-1.fc36.src.rpm

Description:
Truth is a library provides alternative ways to express assertions in
unit tests. It can be used as a replacement for JUnit's assertions or FEST
or it can be used alongside where other approaches seem more suitable.

Fedora Account System Username: orion

This is to un-retire the old truth package.  I am only updating the version to 0.42 because newer versions have incompatibilities with the currently packaged versions of other libs, but hopefully the presence of this will help update those.

Comment 1 Didik Supriadi 2021-10-24 04:48:26 UTC
Hi,

I found an issue about duplicates in %files.
> warning: File listed twice: /usr/share/java/truth

It seems like you need to remove %dir %{_javadir}/%{name} because it's already listed in .mfiles

These are not blockers:
- You could simplified your spec files

diff --git a/truth.spec b/truth.spec
index 1e3e1db..0f5add9 100644
--- a/truth.spec
+++ b/truth.spec
@@ -28,11 +28,7 @@ Truth is a library provides alternative ways to express assertions in
 unit tests. It can be used as a replacement for JUnit's assertions or FEST
 or it can be used alongside where other approaches seem more suitable.
 
-%package        javadoc
-Summary:        Javadoc for %{name}
- 
-%description javadoc
-This package contains the API documentation for %{name}.
+%{?javadoc_package}
 
 %prep
 %setup -q -n %{name}-release_0_42
@@ -61,8 +57,7 @@ This package contains the API documentation for %{name}.
 sed -i 's/1\.7/1.8/' pom.xml
 
 # Fix difflib
-%pom_change_dep com.googlecode.java-diff-utils:diffutils io.github.java-diff-utils:java-diff-utils
-%pom_change_dep com.googlecode.java-diff-utils:diffutils io.github.java-diff-utils:java-diff-utils core
+%pom_change_dep com.googlecode.java-diff-utils:diffutils io.github.java-diff-utils:java-diff-utils . core
 find -name '*.java' -exec sed -i -e '/^import/s/ difflib\.Patch/ com.github.difflib.patch.Patch/' \ 
     -e '/^import/s/ difflib\.DiffUtils\.generateUnifiedDiff;/ com.github.difflib.UnifiedDiffUtils.generateUnifiedDiff;/' \ 
     -e '/^import/s/ difflib\./ com.github.difflib./'  {} + 
@@ -95,9 +90,6 @@ find -name '*.java' | xargs sed -ri \ 
 
 %files -f .mfiles
 %doc README.md
-%dir %{_javadir}/%{name}
-%license LICENSE
-%files javadoc -f .mfiles-javadoc
 %license LICENSE

- These are missing classes but I think it's fine (https://www.baeldung.com/java-package-info#purposes-of-package-info)

[dsupriadi@fedora ~]$ diff-jars truth-0.42.jar truth.jar 
--- /tmp/truth-0.42.jar.list.yJMS4U     2021-10-24 11:29:52.686614185 +0700
+++ /tmp/truth.jar.list.d2KDXa  2021-10-24 11:29:52.980616306 +0700
@@ -87,7 +87,6 @@
 com/google/common/truth/MultisetSubject.class
 com/google/common/truth/ObjectArraySubject.class
 com/google/common/truth/Ordered.class
-com/google/common/truth/package-info.class
 com/google/common/truth/Platform$ComparisonFailureMessageStrategy.class
 com/google/common/truth/Platform$JUnitTestRule.class
 com/google/common/truth/Platform$PlatformComparisonFailure.class
[dsupriadi@fedora ~]$ diff-jars truth-proto-extension-0.42.jar truth-proto-extension.jar 
--- /tmp/truth-proto-extension-0.42.jar.list.Ha3SOP     2021-10-24 11:30:05.075703546 +0700
+++ /tmp/truth-proto-extension.jar.list.ZoDRIw  2021-10-24 11:30:05.359705594 +0700
@@ -85,7 +85,6 @@
 com/google/common/truth/extensions/proto/MultimapWithProtoValuesSubject$MultimapWithMessageValuesSubject.class
 com/google/common/truth/extensions/proto/MultimapWithProtoValuesSubject$MultimapWithProtoValuesFluentAssertionImpl.class
 com/google/common/truth/extensions/proto/MultimapWithProtoValuesSubject.class
-com/google/common/truth/extensions/proto/package-info.class
 com/google/common/truth/extensions/proto/ProtoFluentAssertion.class
 com/google/common/truth/extensions/proto/ProtoSubject$1.class
 com/google/common/truth/extensions/proto/ProtoSubject$MessageSubject$1.class

Comment 2 Orion Poplawski 2021-10-28 04:12:23 UTC
Thanks for the comments.

* Wed Oct 27 2021 Orion Poplawski <orion> - 0.42-2
- Simplify spec from review
- Disable protobuf extensions

Spec URL: https://www.cora.nwra.com/~orion/fedora/truth.spec
SRPM URL: https://www.cora.nwra.com/~orion/fedora/truth-0.42-2.fc36.src.rpm

https://koji.fedoraproject.org/koji/taskinfo?taskID=77943212

Comment 3 Didik Supriadi 2021-10-28 04:37:27 UTC
Package Review
==============

Key:
- = N/A
x = Check
! = Problem
? = Not evaluated


=== Generic reqired items ===

[x] rpmlint must be run on the source rpm and all binary rpms the
    build produces. The output should be posted in the review.

[x] The package must be named according to the Package Naming
    Guidelines.

[x] The spec file name must match the base package %{name}, in the
    format %{name}.spec unless your package has an exemption.

[x] The package must meet the Packaging Guidelines.

[x] The package must be licensed with a Fedora approved license and
    meet the Licensing Guidelines.

[x] The License field in the package spec file must match the actual
    license.

[x] If (and only if) the source package includes the text of the
    license(s) in its own file, then that file, containing the text of
    the license(s) for the package must be included in %license.

[x] The spec file must be written in American English.

[x] The spec file for the package MUST be legible.

[x] The sources used to build the package must match the upstream
    source, as provided in the spec URL. Reviewers should use
    sha256sum for this task as it is used by the sources file once
    imported into git. If no upstream URL can be specified for this
    package, please see the Source URL Guidelines for how to deal with
    this.

[x] The package MUST successfully compile and build into binary rpms
    on at least one primary architecture.

[-] If the package does not successfully compile, build or work on an
    architecture, then those architectures should be listed in the
    spec in ExcludeArch. Each architecture listed in ExcludeArch MUST
    have a bug filed in bugzilla, describing the reason that the
    package does not compile/build/work on that architecture. The bug
    number MUST be placed in a comment, next to the corresponding
    ExcludeArch line.

[x] All build dependencies must be listed in BuildRequires.

[-] The spec file MUST handle locales properly. This is done by using
    the %find_lang macro. Using %{_datadir}/locale/* is strictly
    forbidden.

[x] Packages must NOT bundle copies of system libraries.

[-] If the package is designed to be relocatable, the packager must
    state this fact in the request for review, along with the
    rationalization for relocation of that specific package. Without
    this, use of Prefix: /usr is considered a blocker.

[x] A package must own all directories that it creates. If it does not
    create a directory that it uses, then it should require a package
    which does create that directory.

[x] A Fedora package must not list a file more than once in the spec
    file’s %files listings. (Notable exception: license texts in
    specific situations)

[x] Permissions on files must be set properly. Executables should be
    set with executable permissions, for example.

[x] Each package must consistently use macros.

[x] The package must contain code, or permissible content.

[x] Large documentation files must go in a -doc subpackage. (The
    definition of large is left up to the packager’s best judgement,
    but is not restricted to size. Large can refer to either size or
    quantity).

[x] If a package includes something as %doc, it must not affect the
    runtime of the application. To summarize: If it is in %doc, the
    program must run properly if it is not present.

[-] Static libraries must be in a -static package.

[-] Development files must be in a -devel package.

[-] In the vast majority of cases, devel packages must require the
    base package using a fully versioned dependency: Requires:
    %{name}%{?_isa} = %{version}-%{release}

[x] Packages must NOT contain any .la libtool archives, these must be
    removed in the spec if they are built.

[-] Packages containing GUI applications must include a
    %{name}.desktop file, and that file must be properly installed
    with desktop-file-install in the %install section. If you feel
    that your packaged GUI application does not need a .desktop file,
    you must put a comment in the spec file with your
    explanation.

[x] Packages must not own files or directories already owned by other
    packages. The rule of thumb here is that the first package to be
    installed should own the files or directories that other packages
    may rely upon. This means, for example, that no package in Fedora
    should ever share ownership with any of the files or directories
    owned by the filesystem or man package. If you feel that you have
    a good reason to own a file or directory that another package
    owns, then please present that at package review time.

[x] All filenames in rpm packages must be valid UTF-8.

[x] Packages being added to the distribution MUST NOT depend on any
    packages which have been marked as being deprecated.


=== Generic optional items ===

[-] If the source package does not include license text(s) as a
    separate file from upstream, the packager SHOULD query upstream to
    include it.

[x] The reviewer should test that the package builds in mock.

[x] The package should compile and build into binary rpms on all
    supported architectures.

[!] The reviewer should test that the package functions as
    described. A package should not segfault instead of running, for
    example.

[-] If scriptlets are used, those scriptlets must be sane. This is
    vague, and left up to the reviewers judgement to determine sanity.

[x] Usually, subpackages other than devel should require the base
    package using a fully versioned dependency.

[-] The placement of pkgconfig(.pc) files depends on their usecase,
    and this is usually for development purposes, so should be placed
    in a -devel pkg. A reasonable exception is that the main pkg
    itself is a devel tool not installed in a user runtime, e.g. gcc
    or gdb.

[-] If the package has file dependencies outside of /etc, /bin, /sbin,
    /usr/bin, or /usr/sbin consider requiring the package which
    provides the file instead of the file itself.

[-] The package should contain man pages for binaries/scripts. If it
    doesn’t, work with upstream to add them where they make sense.


=== Java required items  ===

[x] Binary *.class and *.jar files from upstream releases MUST NOT be
    used during build of Fedora packages and they MUST NOT be included
    in binary RPM.

[x] All architecture-independent JAR files MUST go into %{_javadir} or
    its subdirectory.

[x] Java packages MUST BuildRequire their respective build system:

[-] Java binary packages MUST have transitive Requires on:
    java-headless, java, java-devel

[-] Java binary packages MUST have transitive Requires on:
    javapackages-filesystem, javapackages-tools

[x] If javadoc documentation is generated it MUST be installed into a
    directory of %{_javadocdir}/%{name} as part of %{name}-javadoc
    subpackage

[-] Compatibility packages MUST be named in the same way as original
    except addition of version to package name,

[-] Any compatibility JAR and POM files MUST be versioned.


=== Java optional items  ===

[x] If the package provides a single JAR file installed filename
    SHOULD be %{name}.jar.

[!] If the package provides multiple JAR files, they SHOULD be
    installed in a %{name} subdirectory.

[-] Applications wishing to provide a convenient method of execution
    SHOULD provide a wrapper script in %{_bindir}. Packages SHOULD use
    %jpackage_script to create these wrapper scripts.


=== rpmlint output ===
truth.src: W: strange-permission truth-0.42.tar.gz 660
truth.src: W: strange-permission truth.spec 660
1 packages and 1 specfiles checked; 0 errors, 2 warnings.


================
*** APPROVED ***
================

Comment 4 Orion Poplawski 2021-10-28 13:23:19 UTC
Thank you for the review.  Untretirement requested: https://pagure.io/releng/issue/10361


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