On 2013-03-13 10:09, Alec Leamas wrote:
On 2013-03-13 09:40, Pavel Raiskup wrote:
> Hello reviewers!
>
> I am trying to write some autotools related checker and I found that
> there
> is a problem with checkers dependencies.
>
> The problem I was facing was that I need in my check the 'buildsrc'
> to be
> initialized. This shouldn't be a problem as each check is automatically
> dependant on 'CheckBuildCompleted', am I right?
>
> But when I tried to run something like this:
>
> $ ./try-fedora-review --name tar -s \
> CheckAutotoolsObsoleteMarcos
>
> .. the try-fedora-review script was unable to prepare the check-system
> (mock, review directories, etc.) properly. The problem IMO is that you
> have there something like this (in src/FedoraReview/check_base.py):
>
> 138 return None
> 139
> 140 is_run = property(lambda self: hasattr(self, 'result'))
>
> The main problem here is IMO that the 'result' attribute is (almost?)
> always set to some default value. Even if the test has not been run
> yet.
>
> Possible solution (that fixes the bad behavior for me) is in attachment
> but I'm not very familiar with internals of FedoraReview code. The only
> thing I am aware that it is pretty annoying :) - it will always fail on
> workdir_setup() call which does workdir lazy initialization but its
> requirements are not met yet (due to not-ran checks).
>
> I would also rename the is_run to something like 'finished' or some past
> tense form.. if you are interested - I'm able to generate patch.
>
> Pavel
>
>
Well, that patch fails in first test so....
That said, your usecase is actually interesting, I've considered
something similar. Could you maybe share a little more about what you
are trying to do?
--alec
The problem is that when running a single test (using -s/--single) you
run exactly that test, it does not respect the needs property. This is
on purpose to give full flexiblity when using this switch.
What you can do is to run each test you want in a sequence, something like
.$ ./try-fedora-review -rn tar -s CheckBuild
$ ./try-fedora-review -rn tar -s CheckBuildCompleted --no-build
$ ./try-fedora-review -rn tar -s CheckMyFancyTest --no-build
Depending on your needs, there is --no-build and --cache. I actually
havn't the complete picture (although I've been messing with this code
quite a lot), but my gut feeling is that should be able to do what you
want using this kind of technique.
I will add a note in the manpage for the -s option; as of today, this is
clear as mud ):
--alec