I had something like this on my mind:

~~~

$ diff -u rubygem-asciidoctor-diagram.spec{,.orig}
--- rubygem-asciidoctor-diagram.spec    2020-11-18 10:07:55.687486987 +0100
+++ rubygem-asciidoctor-diagram.spec.orig    2020-11-18 10:05:33.015423167 +0100
@@ -1,7 +1,5 @@
 %global gem_name asciidoctor-diagram

-%bcond_with missing_test_dependencies
-
 Name: rubygem-%{gem_name}
 Version: 2.0.5
 Release: 1%{?dist}
@@ -33,10 +31,6 @@
 BuildRequires: rubygem(prawn-svg)
 BuildRequires: rubygem(asciidoctor-pdf)
 BuildRequires: rubygem(bigdecimal)
-# Not packaged in Fedora.
-%if %{with missing_test_dependencies}
-BuildRequires: %{_bindir}/a2s
-%endif

 BuildArch: noarch

@@ -67,14 +61,11 @@

 %check
 # Run the test excluding extensions which are not packaged yet
-rspec \
-%if %{without missing_test_dependencies}
- --exclude-pattern 'spec/{a2s_spec.rb,bpmn_spec.rb,bytefield_spec.rb,dpic_spec.rb, +rspec --exclude-pattern 'spec/{a2s_spec.rb,bpmn_spec.rb,bytefield_spec.rb,dpic_spec.rb,
erd_spec.rb,mermaid_spec.rb,nomnoml_spec.rb,pikchr_spec.rb,
umlet_spec.rb,vega_spec.rb,syntrax_spec.rb,
shaape_spec.rb,smcat_spec.rb,svgbob_spec.rb,
                          symbolator_spec.rb,wavedrom_spec.rb}'
-%endif

 %files
 %dir %{gem_instdir}

~~~


This is not complete neither tested (I might have the bcond wrong). But the idea is, that you later run:


~~~

$ mock rubygem-asiidoctor-diagrem.srpm --with missing_test_dependencies

~~~


this will execute all the test cases (you can use the `--with` also with plain rpmbuild if I am not mistaken). So if you install the dependencies, such as a2s into mock via other means (you can run `mock shell` to prepare the environment), then you could execute the entire test suite.

Similar approach is used here for example:

https://src.fedoraproject.org/rpms/rubygem-mongo/blob/master/f/rubygem-mongo.spec

Since we don't have MongoDB in Fedora, we can't run the test suite during official build, but it is useful to execute it at leas locally during preparation of the update.


Vít


Dne 16. 11. 20 v 19:00 Christopher Brown napsal(a):
Hi Vit,



On Mon, 16 Nov 2020 at 09:54, Vít Ondruch <vondr...@redhat.com <mailto:vondr...@redhat.com>> wrote:


    Dne 13. 11. 20 v 17:46 Christopher Brown napsal(a):
    Hi folks,

    I've got a working build of asciidoctor-diagram ready for review:

    https://bugzilla.redhat.com/show_bug.cgi?id=1897619
    <https://bugzilla.redhat.com/show_bug.cgi?id=1897619>

    Spec file:

    
https://raw.githubusercontent.com/snecklifter/rubygem-asciidoctor-diagram/master/rubygem-asciidoctor-diagram.spec
    
<https://raw.githubusercontent.com/snecklifter/rubygem-asciidoctor-diagram/master/rubygem-asciidoctor-diagram.spec>

    @Dan - this includes support for graphviz, plantuml, and
    blockdiag you mentioned plus a few others that are already packaged.

    Appreciate any eyes on this, particularly with regards to running
    rspec as I'm specifically running just the tests for the
    attributes that are available.


    Wouldn't it be better to use exclude pattern instead of includes?

Done

    Also, it would deserve some comments a top of the BRs you exclude
    as well as in the %check section.

Done

    Maybe it'd better to use `bcond_with` to enable the rest of the
    test suite, because in theory, for testing in mock, it should be
    enough to have the missing pieces installed by hand. But since
    it'd make the .spec file more complex, feel free to ignore this
    suggestion ;)

Can you explain this a bit more? We are mostly missing nodejs extensions but aside from invoking npm (which I don't think we do in builds ...) I can't see how this would work?

    Also, I'd the dependencies on binaries, such as `BuildRequires:
    %{_bindir}/graphviz`(this might be a wrong example, since you
    require the graphviz-ruby, but you get the point).

I'll take a look at converting the spec file to this.

In the meantime, if anyone is able to do a review that would be good.


    Vít



    Regards
    Christopher

    On Tue, 3 Nov 2020 at 10:19, Christopher Brown
    <chris.br...@redhat.com <mailto:chris.br...@redhat.com>> wrote:

        Neal, Dan,

        Thanks both, I think we have a way forward. I'll start the
        dialog upstream.

        @Neal - would it be possible to update the Fedora wiki
        regarding bundling Nodejs deps? Not sure if it needs to be:

        
https://fedoraproject.org/wiki/Bundled_Libraries?rd=Packaging:Bundled_Libraries
        
<https://fedoraproject.org/wiki/Bundled_Libraries?rd=Packaging:Bundled_Libraries>

        or

        https://fedoraproject.org/wiki/Packaging:Node.js
        <https://fedoraproject.org/wiki/Packaging:Node.js>

        I'm unable to do so because I get the error message: "The
        action you have requested is limited to users in the group:
        Packaging."

        On Mon, 2 Nov 2020 at 22:06, Neal Gompa <ngomp...@gmail.com
        <mailto:ngomp...@gmail.com>> wrote:

            On Mon, Nov 2, 2020 at 10:41 AM Christopher Brown
            <chris.br...@redhat.com <mailto:chris.br...@redhat.com>>
            wrote:
            >
            > Hi Dan,
            >
            > Thanks for this. The issue I think is that there is a
            large number of dependencies and AIUI, Fedora doesn't
            allow these to be bundled with the gem[1]. This means a
            fairly significant task creating packages for a variety
            of nodejs dependencies amongst other things, e.g. Vega[2]
            has a fairly rapid release schedule.
            >
            > The more I consider the situation, the more I'm
            thinking that rpm is not the correct packaging format for
            asciidoctor-pdf and friends given their long list of
            dependencies and that a better fit would be a
            containerised deployment or perhaps flatpak/snap.
            >
            > However I thought I'd put this out for further
            responses from anyone with a vested interest.
            >
            > 1.
            
https://fedoraproject.org/wiki/Bundled_Libraries?rd=Packaging:Bundled_Libraries
            
<https://fedoraproject.org/wiki/Bundled_Libraries?rd=Packaging:Bundled_Libraries>
            > 2. https://github.com/vega/vega/tags
            <https://github.com/vega/vega/tags>
            >

            Bundling Nodejs dependencies is perfectly fine. Most of
            us do that
            now. Gem and C/C++ dependencies should not be bundled,
            though.



-- 真実はいつも一つ!/ Always, there's only one truth!
            _______________________________________________
            ruby-sig mailing list -- ruby-sig@lists.fedoraproject.org
            <mailto:ruby-sig@lists.fedoraproject.org>
            To unsubscribe send an email to
            ruby-sig-le...@lists.fedoraproject.org
            <mailto:ruby-sig-le...@lists.fedoraproject.org>
            Fedora Code of Conduct:
            https://docs.fedoraproject.org/en-US/project/code-of-conduct/
            <https://docs.fedoraproject.org/en-US/project/code-of-conduct/>
            List Guidelines:
            https://fedoraproject.org/wiki/Mailing_list_guidelines
            <https://fedoraproject.org/wiki/Mailing_list_guidelines>
            List Archives:
            
https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org
            
<https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org>



-- Christopher Brown
        Senior Consultant
        Red Hat UK Ltd
        chris.br...@redhat.com <mailto:chris.br...@redhat.com>



-- Christopher Brown
    Senior Consultant
    Red Hat UK Ltd
    chris.br...@redhat.com <mailto:chris.br...@redhat.com>

    _______________________________________________
    ruby-sig mailing list --ruby-sig@lists.fedoraproject.org  
<mailto:ruby-sig@lists.fedoraproject.org>
    To unsubscribe send an email toruby-sig-le...@lists.fedoraproject.org  
<mailto:ruby-sig-le...@lists.fedoraproject.org>
    Fedora Code of 
Conduct:https://docs.fedoraproject.org/en-US/project/code-of-conduct/  
<https://docs.fedoraproject.org/en-US/project/code-of-conduct/>
    List Guidelines:https://fedoraproject.org/wiki/Mailing_list_guidelines  
<https://fedoraproject.org/wiki/Mailing_list_guidelines>
    List 
Archives:https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org
  
<https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org>
    _______________________________________________
    ruby-sig mailing list -- ruby-sig@lists.fedoraproject.org
    <mailto:ruby-sig@lists.fedoraproject.org>
    To unsubscribe send an email to
    ruby-sig-le...@lists.fedoraproject.org
    <mailto:ruby-sig-le...@lists.fedoraproject.org>
    Fedora Code of Conduct:
    https://docs.fedoraproject.org/en-US/project/code-of-conduct/
    <https://docs.fedoraproject.org/en-US/project/code-of-conduct/>
    List Guidelines:
    https://fedoraproject.org/wiki/Mailing_list_guidelines
    <https://fedoraproject.org/wiki/Mailing_list_guidelines>
    List Archives:
    
https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org
    
<https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org>



--
Christopher Brown
Senior Consultant
Red Hat UK Ltd
chris.br...@redhat.com <mailto:chris.br...@redhat.com>

_______________________________________________
ruby-sig mailing list -- ruby-sig@lists.fedoraproject.org
To unsubscribe send an email to ruby-sig-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org

Attachment: OpenPGP_0x0CE09EE79917B87C.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
ruby-sig mailing list -- ruby-sig@lists.fedoraproject.org
To unsubscribe send an email to ruby-sig-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org

Reply via email to