The armv7hl vs armhfp issue was raising its head. Also correct typo
Details
- Reviewers
jdulaney jskladan - Group Reviewers
libtaskotron
Run taskotron with arm repos; without this patch, that fails.
Diff Detail
- Repository
- rLTRN libtaskotron
- Lint
Lint Skipped - Unit
Unit Tests Skipped
The code fails both lint check, and unit tests.
When you create the diffs, use arc diff command. That will run both checks, and also make sure you set reviewers, and correct repo for the diff, so the context can be seen in phab, and so on.
| libtaskotron/arch_utils.py | ||
|---|---|---|
| 41 | https://admin.fedoraproject.org/mirrormanager/ seems to use armhfp only. Where is armv7hl being used? Thanks. Also, if you change it here, you also need to change it in Arches.all. | |
| 43–46 | The docstring says:
If you do a change like this, you need to adjust the documentation as well. However, the intention here was to return basearch if available, otherwise the supplied arch. You can easily see if your arch is known at all or at least base by using Arches.all and Arches.base. So I don't really see why this method should throw an error. Why do you need it? Also, this method has nothing to do with yumrepoinfo directive, so it is very confusing to mention it here. | |
| libtaskotron/directives/yumrepoinfo_directive.py | ||
| 129 | Why was this change necessary? Please provide a use case. | |
Just out of curiosity, which lint are you referring to? pylint says that I (slightly) improved this code over the original.
Also, functional testing was producing the following error prior to these changes:
E assert 2 == 1
E + where 2 = len(['[libtaskotron:functest_logger.py:75] 2016-03-08 20:42:12 WARNING A warn message lai_choow5Ie\n', '[libtaskotron:functest_logger.py:75] 2016-03-08 20:42:29 WARNING A warn message lai_choow5Ie\n'])
flake8, the linter that we configured arcanist to run before submitting reviews.
Also, functional testing was producing the following error prior to these changes:
E assert 2 == 1
E + where 2 = len(['[libtaskotron:functest_logger.py:75] 2016-03-08 20:42:12 WARNING A warn message lai_choow5Ie\n', '[libtaskotron:functest_logger.py:75] 2016-03-08 20:42:29 WARNING A warn message lai_choow5Ie\n'])
the funtests run fine on my machine, is anyone else seeing this failure?
To be more specific, the functests run fine for me on origin/develop but both unit tests and the functests fail when I run them against this patch. There is also a lint error. Why are you skipping the unit tests and lint?
Reverted the error handling change. Still, before we check to see if the arch is in the basearch list, we need to normalize the arch names. armv7hl vs armhfp is an example of this requirement.
Also, the Arches class in arch_utils.py is not necessary; better to have the constants defined directly and not have the overhead of a class. This change requires four lines of code be changed elsewhere, two of which are imports, and one of which I was changing anyway.
Tests now mostly pass, with the one exception being a failure that was already present.
| libtaskotron/arch_utils.py | ||
|---|---|---|
| 41 | Here I am fixing an existing spelling error. the repos are named armhfp but the arch attached to the rpm is armv7hl. This normalizes to the repo arch name. | |
| libtaskotron/directives/yumrepoinfo_directive.py | ||
| 129 | This is due to the weirdness with arm, armvhl vs armhfp, which is handeled in the basearch function. | |
I reverted all my changes and still got this one specific failure.
| libtaskotron/arch_utils.py | ||
|---|---|---|
| 37 | I'll give the docs a poke here shortly. | |
I have looked at it and it really seems we have a typo in arm7hl, it doesn't seem to be used anywhere, it should be armv7hl. You're right about that.
Please use code blocks and give us the full error so that we see where it is coming from. This seems to be functest_logger.py:test_memhandler_to_logfile_level. Can you try doing a clean checkout of our git, switch to develop branch, and run py.test -F testing/. Is it still failing? If it is, ping one of us on #fedora-qa and we'll try to figure out what's wrong. The test suite must not be failing.
Please read the dev guide I posted. Before submitting next version of the patch, try running arc unit and arc lint to see test suite errors and lint errors. Then update this diff using arc diff develop --update D766.
| libtaskotron/arch_utils.py | ||
|---|---|---|
| 8 | This import seems no longer necessary. | |
| 11–18 | Just because you need to fix a typo, please don't overhaul the whole module. I prefer the class approach, because it can be changed and passed without changing it globally. Also makes testing easier. But that's not the point. The bugfix should always be minimal, and if you want to restructure something, propose it as a separate diff. Thanks. | |
| 15 | So why haven't you changed the typo here? | |
| 37 | No longer needed, since you no longer raise the exception. | |
| libtaskotron/directives/yumrepoinfo_directive.py | ||
| 130–133 | I'm starting to understand why you need this. You want to be able to give armv7hl as an argument to yumrepoinfo_directive and want it to spit out a repository for armhfp. So why exactly don't you give it armhfp right away, where are you getting this value from? I'm fine with the change to convert everything to basearch first. You should mention it in the directive documentation, though. Also, why don't you do it like this? processed_arches = [basearch(arch) for arch in arches if basearch(arch) in Arches.base] And more importantly, now you need to make sure we don't repeat the same basearch several times, so like this: processed_arches = set([basearch(arch) for arch in arches if basearch(arch) in Arches.base]) And possibly a comment for clarity, if you want: # convert everything to basearch, exclude everything that is not basearch, and make it unique processed_arches = set([basearch(arch) for arch in arches if basearch(arch) in Arches.base]) | |
The armv7hl typo is now fixed in D857. The arch_utils were also restructured a bit. I'm closing this. If you still need some changes, please update and reopen, thanks.
This import seems no longer necessary.