yumrepoinfo directive now handles multiple arch
ClosedPublic

Authored by lbrabec on Aug 28 2014, 9:13 AM.

Details

Summary

Multiple arches can be passed to yumrepoinfo directive, output has new format:

{'koji_tag': {'arch': 'URL'}}
Test Plan

python runtask.py -t koji_tag -a i386 -a x86_64 -i f20-updates-pending yumrepoinfo.yml --debug

where yumrepoinfo.yml contains:

---
name: repoinfo
desc: "blah blah"
maintainer: nobody

input:
    args:
        - koji_tag
        - arch

environment:
    rpm:
        - libtaskotron

actions:
    - name: get yum repos
      yumrepoinfo:
          koji_tag: ${koji_tag}
          arch: ${arch}
      export: yumrepos

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lbrabec retitled this revision from to yumrepoinfo directive now handles multiple arch.Aug 28 2014, 9:13 AM
lbrabec updated this object.
lbrabec edited the test plan for this revision. (Show Details)
lbrabec added a reviewer: jskladan.
kparal requested changes to this revision.Sep 5 2014, 12:42 PM

Can you please add a unit test that would test multiple arches being fed to this directive? Thanks.

libtaskotron/directives/yumrepoinfo_directive.py
26–28

This is no longer true, is it?

30–43

This starts to be complicated, I think including a simple example would help a lot.

91–92

Please use concrete parameters here, instead of input_data and env_data. Add a docstring describing the purpose of this method.

This revision now requires changes to proceed.Sep 5 2014, 12:42 PM
lbrabec updated this revision to Diff 825.Feb 27 2015, 10:16 AM
  • code polishing, documentation
lbrabec updated this revision to Diff 826.Feb 27 2015, 10:24 AM
  • pep polishing
jskladan accepted this revision.Mar 3 2015, 9:46 AM

Looks good to me, please provide also patches (in separate reviews) for tasks using the directive (set as dependencies for this one) before pushing to develop.

kparal requested changes to this revision.Mar 3 2015, 1:55 PM
In D224#3981, @kparal wrote:

Can you please add a unit test that would test multiple arches being fed to this directive? Thanks.

I cannot find this. The usual use case should be tested (multiple real arches passed in) as well the edge cases (one real arch with one "meta" arch, two real arches with one "meta" arch, several "meta" arches and no real arch, and maybe something else).

libtaskotron/directives/yumrepoinfo_directive.py
38–39

This is a bit hard to read on a single line (and some of the quotes are doubled). What about:

Example::

    {'f20': {'x86_64': 'http://...',
             'i386': ''http://...'},
     'f20-updates': {'x86_64': 'http://...',
                     'i386': 'http://...'}}

This will keep formatting in the generated docs.

44–45

This is no longer true.

This revision now requires changes to proceed.Mar 3 2015, 1:55 PM
lbrabec updated this revision to Diff 828.Mar 4 2015, 11:04 AM
  • doc polishing, test addition
kparal added a comment.Mar 4 2015, 2:08 PM

The patch looks OK in general, the unit tests look reasonable. If you can use tmpdir and adjust the few nitpicks, that would be great.

libtaskotron/directives/yumrepoinfo_directive.py
41

One of the quotes is still doubled :-)

46

For clarity, and should be replaced with or

90

Is there a reason to not make this a docstring?

testing/test_yumrepoinfo_directive.py
1

Can you have a look at tmpdir [1] fixture from pytest, as used in other test modules? I think it should be able to give you what you need and it has many advantages, like rotating temp files and using a centralized temp directory.

[1] http://pytest.org/latest/tmpdir.html

lbrabec updated this revision to Diff 832.Mar 4 2015, 2:21 PM
  • code polishing
This revision is now accepted and ready to land.Mar 4 2015, 2:50 PM
Closed by commit rLTRNe33408f158a9: yumrepoinfo directive now handles multiple arch (authored by Lukas Brabec <lbrabec@redhat.com>). · Explain WhyMar 4 2015, 3:26 PM
This revision was automatically updated to reflect the committed changes.