default lib for import_comps changed to libcomps, if it's not available, fall back to yum.comps
The logic in Koji looks good, and it's nice that tests are accompanied with it.
Works for me. What about updating spec file with
%if 0%{?fedora} Requires: python-libcomps %endif
@tkopecek: I'd suggest the following:
%if 0%{?fedora} || 0%{?rhel} >= 6 Requires: python-libcomps %endif
Though if libcomps can be built for RHEL/CentOS 5 (I haven't tried), that'd be even better.
libcomps is now only available in epel7 AFAIK, so I've preferred to not put hard require there.
@tkopecek It was built for EL6 at one point: http://koji.fedoraproject.org/koji/buildinfo?buildID=681053
However, it seems that it was never submitted to bodhi and got trashed instead...
Questions about the unit tests:
*.calls
*.out
Also, the new tests fail if python-libcomps is not present (or yum.comps). Perhaps we should just conditionally skip this tests? E.g.
https://github.com/mikem23/koji-playground/commits/libcomps
rebased
Questions about the unit tests: why are the comps-example tests disabled by default? Just for size? (they seem pretty quick here)
why are the comps-example tests disabled by default? Just for size? (they seem pretty quick here)
Yes, just for speed, and this test's no help for code coverage. comps-example.xml is fedora26's comps generated by fedora-comps. The two tests is more like integration tests for making sure this functionality can be used in real world. I followed @tkopecek 's idea in jira issue to skip them.
why two comps files for testing? Do they hit different areas of code?
explained above^^^
how are the .calls and .out files generated?
I added a function to generate them. the generated should be carefully checked, after cli._import_comps and cli._import_comps_alt are changed
cli._import_comps
cli._import_comps_alt
Also, the new tests fail if python-libcomps is not present (or yum.comps). Perhaps we should just conditionally skip this tests? E.g. https://github.com/mikem23/koji-playground/commits/libcomps
Thanks. I've rebased your code into this PR.
@tkopecek @ngompa libcomps dependency was added by @mikem 's commit. It's only for fedora. Please check.
Please add || 0%{?rhel} >= 7 to this conditional.
|| 0%{?rhel} >= 7
@ngompa updated
1 new commit added
This looks okay to merge to me, now.
:thumbsup:
Commit 0e664ad7 fixes this pull-request
Pull-Request has been merged by mikem@redhat.com
default lib for import_comps changed to libcomps, if it's not available, fall back to yum.comps