----- Original Message -----
This adds the new 'depcheck' test, which checks new updates
to ensure
their dependencies are all met, and sends feedback to Bodhi if so.
Thanks, Will, for your effort on this complicated test!
A few comments:
1. Could you please split depcheck unittest into a separate file?
That would make the whole file much easier to read.
2. I see that you're importing _check_already_commented from
bodhi_utils. That method is private. Should we change it to public?
PS: bodhi_post_testresult should automatically handle duplicate
comment detection.
3. Could you please print a few status messages inside the test?
For example "Downloading XXX.rpm" messages would be great, so that
we know it's not stuck and what progress is.
4. On the other hand, the depcheck script itself is extremely verbose:
http://kparal.fedorapeople.org/autoqa/depcheck.log
Will the developers be able to identify the source of the dependency
problem? Do we have any hints for them? In this case, the boost package
failed the check.
5. There was some traceback in my depcheck run (jlaska's patch applied
and a few printouts added from me), please see log above.
Further comments below.
control.autoqa:
# we want to run this test just for post-koji-build hook
if hook not in ['post-bodhi-update']:
execute = False
The comment does not match the code.
depcheck.py:
# Get our inputs
pending = list_pending_updates(kojitag)
# XXX set testarch to noarch for noarch updates?
accepted = filter(is_accepted, pending)
This goes through -pending updates, searching for a PASSED comment,
and puts them into ACCEPTED set if they have one. That is I believe
not sufficient, see the comments in here:
http://blogs.fedoraproject.org/wp/wwoods/2011/01/03/depcheck-tags-and-tim...
We have to remember the -pending set in some cachefile, and then
check whether the new -pending set is a superset of the old -pending
set. If it is not, we have to invalidate that set.
+ # Post bodhi results for the current update
+ if self.result == "PASSED":
+ # NOTE: this had better match what's in is_accepted
+ bodhi_post_testresult(name, 'depcheck', self.result, url, testarch,
karma=0)
+
+ # Also post results for any other newly-passing updates
+ oldupdates = {}
+ # Find the updates that correspond to the passed NVRs
+ for nvr in passed_nvrs:
+ update = bodhi_list({'package':nvr})
+ if update['title'] not in oldupdates:
+ oldupdates[update['title']] = update
+ # If every NVR in the update is OK, post good results
+ for (title, update) in oldupdates.iteritems():
+ updateok = True
+ for build in update['builds']:
+ if build['nvr'] not in passed_nvrs:
+ updateok = False
+ break
+ if updateok:
+ bodhi_post_testresult(update['title'], 'depcheck', 'PASSED',
url,
testarch, karma=0)
+
+ # TODO: notify maintainers when an update is rejected - but ONLY
once
This seems a little complicated for me. Why don't we simply post test
result to every update in the pending set? Our bodhi_post_testresult()
method automatically cares about comment duplication.
If you need to convert NVR to Bodhi update object (or its title),
this is the approach:
>> from fedora.client import BodhiClient
>> bodhi = BodhiClient()
>> update = bodhi.query(package='sunbird-1.0-0.32.b3pre.fc14')
>> update['updates'][0]['title']
'sunbird-1.0-0.32.b3pre.fc14,thunderbird-3.1.6-2.fc14'
(let's make a method for it in bodhi_utils).