[AutoQA] #280: Remove Koji configuration from AutoQA
by fedora-badges
#280: Remove Koji configuration from AutoQA
--------------------+-------------------------------------------------------
Reporter: kparal | Owner:
Type: task | Status: new
Priority: minor | Milestone: Finger Food
Component: core | Keywords:
--------------------+-------------------------------------------------------
Currently we allow user to configure which Koji instance to use (which
URLs to use) in /etc/autoqa/autoqa.conf. Now I have found out that the
same set of URLs can also be configured in /etc/koji.conf. In the latter
case if obviously also influences "koji" command, the first case does not.
The task is:
1. To start a discussion whether we want to leave our code intact (i.e.
having the ability to configure Koji server just for AutoQA), or simplify
our code and delete Koji configuration from it - it will then inherit the
system-wide configuration.
2. If it is decided to simplify AutoQA code, then remove all Koji
configuration code from AutoQA.
--
Ticket URL: <https://fedorahosted.org/autoqa/ticket/280>
AutoQA <http://autoqa.fedorahosted.org>
Automated QA project
13 years, 3 months
[AutoQA] #278: Fix terminology in AutoQA library
by fedora-badges
#278: Fix terminology in AutoQA library
-------------------------+--------------------------------------------------
Reporter: kparal | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone: Finger Food
Component: core | Keywords:
-------------------------+--------------------------------------------------
We use "NVR", "build", "package" etc pretty randomly in the names of our
library methods. We should stick to the terminology here:
https://fedoraproject.org/wiki/Koji#Terminology
So "nvr_to_rpms()" should be more likely "build_to_rpms()". And so on.
The task is to go through the library and fix the terminology where
needed, especially in the methods' names and their arguments.
--
Ticket URL: <https://fedorahosted.org/autoqa/ticket/278>
AutoQA <http://autoqa.fedorahosted.org>
Automated QA project
13 years, 3 months
a few fixes before the new release
by Kamil Paral
Hello, I pushed a few new commits. Most importantly:
1. There were a few issues with depcheck (querying for updates the old way, etc). Those are fixed.
2. watch-koji-builds used invalid UTC time conversion and that caused no jobs to be scheduled on some machines (depending on timezone). Thanks jlaska for spotting that.
3. upgradepath and depcheck don't crash now when we come across an invalid build (i.e. mainly non-existent in Bodhi). We just set NEEDS_INSPECTION.
commit 28fa6d0feca32646595532138685e94d97b920b5
Author: Kamil Páral <kparal(a)redhat.com>
Date: Fri Mar 11 14:40:37 2011 +0100
depcheck: use koji tags to get pending builds, don't crash for invalid builds
commit 706d626fc3de5a37bfc4e5d8c84818f6e6018f6e
Author: Kamil Páral <kparal(a)redhat.com>
Date: Wed Mar 9 17:51:26 2011 +0100
depcheck: set ABORTED status when downloading a package fails
commit 1edc689ed5f2fb42915fc43faaf528e29ee50d45
Author: Kamil Páral <kparal(a)redhat.com>
Date: Wed Mar 9 16:45:48 2011 +0100
depcheck: add kojitag to summary
commit d95f0cefc2e1128afbcf1fb534e27857b259e4f2
Author: Josef Skladanka <jskladan(a)redhat.com>
Date: Wed Mar 9 16:32:17 2011 +0100
Fixed depcheck's not reporting failed results.
commit 7e7d58477742e0669184cbc910e2b8fc726d4ebc
Author: Kamil Páral <kparal(a)redhat.com>
Date: Fri Mar 11 16:17:47 2011 +0100
watch-koji-builds: fix broken UTC time conversions
commit 2d99103d75bcd669211b55f248e543121ee1db23
Author: Kamil Páral <kparal(a)redhat.com>
Date: Fri Mar 11 14:54:07 2011 +0100
upgradepath: don't crash when nonexistent build approached
13 years, 3 months
Comparison of py.test and nose
by Tim Flink
I finished the comparison of py.test and nose. Links to the detailed
results and code are at the end of this email.
Comments and/or suggestions would be appreciated. Let the discussion
commence!
Tim
Executive Summary:
After a detailed comparison of the two tools, I think that py.test would
be the better choice for a test tool for AutoQA.
Py.test has better documentation, more detailed output on test failure,
more customizability without resorting to custom plugins and better
support for test isolation.
While we would not be able to leverage as much local experience with
py.test, better documentation should lead us towards finding solutions
in that documentation instead of having to rely on the experience of
others to find those solutions.
Detailed Results:
https://fedoraproject.org/wiki/User:Tflink/AutoQA_nose_pytest_comparison
py.test code:
https://github.com/tflink/autoqa-devel/tree/pytest
nose code:
https://github.com/tflink/autoqa-devel/tree/nose
NOTE: I didn't see a point in merging this to the fedorahosted repo
since its just a proof of concept. This can be done if desired, though.
13 years, 3 months
Patch Submission Guidelines
by Kamil Paral
Our team is growing, I felt the need to create some patch submission guidelines, so we all know how to cooperate efficiently. I put it here:
https://fedoraproject.org/wiki/AutoQA_Patch_Process#AutoQA_developers
The main concept is that we are a small team with a lot of work on our plate, so it's better to possibly revert some bad patches rather then force people to wait for some approvals. The technology (git) allows us to make (and revert) mistakes, so let's make use of that and eliminate bureaucratic processes. I definitely don't want to be a frog on a spring (Czech saying) that must approve every single proposed patch before pushing it into master. Nope, I know better than that - you're all responsible for that! :-)
This partly relates to the recent Tim's work - I still didn't have time to go through that, I'm sorry. But if anyone else agrees it looks good, then it probably looks good. And that applies to everyone's work. Of course, using common sense is strongly advised in all possible circumstances :-)
Good/bad?
Thanks,
Kamil
13 years, 3 months
[PATCH] Create function to download RPMs from koji for given NVR (second try)
by Tim Flink
Create function to download RPMs from koji for given NVR
Let's try this again, without the wrapping. I'll push to a remote branch
if this doesn't turn out.
This patch for master provides a fix for #265 without the extra py.test
stuff from my pytest branch. It also changes 2 tests to use the new
function. I have tested this on my local setup and as far as I can tell,
it works with no regressions.
There were some concerns about the refactoring that I did in
koji_utils.py. I can remove those changes and re-submit if desired.
Tim
diff --git a/lib/python/koji_utils.py b/lib/python/koji_utils.py
index 1eb2c44..71d6d8a 100644
--- a/lib/python/koji_utils.py
+++ b/lib/python/koji_utils.py
@@ -25,26 +25,40 @@ from repoinfo import repoinfo
import rpmUtils.miscutils
import sys
from autoqa.config import SingleConfigParser, autoqa_conf
+import urlgrabber.grabber
+import os.path
-kojiurl = autoqa_conf.get('resources', 'koji_url')
-pkgurl = autoqa_conf.get('resources', 'pkg_url')
+class SimpleKojiClientSession():
-class SimpleKojiClientSession(koji.ClientSession):
- '''Convenience wrapper class for interacting with koji'''
- def __init__(self, server=kojiurl, opts=None):
- return koji.ClientSession.__init__(self, server, opts)
+ '''Convenience wrapper class for interacting with kojiclient'''
+ def __init__(self, server=None, opts=None, kojiclient=None, url_grabber=None):
+ self.kojiurl = autoqa_conf.get('resources', 'koji_url')
+ self.pkgurl = autoqa_conf.get('resources', 'pkg_url')
+
+ if server == None:
+ server = self.kojiurl
+
+ if kojiclient == None:
+ self.kojiclient = koji.ClientSession(server, opts)
+ else:
+ self.kojiclient = kojiclient
+
+ if url_grabber == None:
+ self.url_grabber = urlgrabber.grabber.URLGrabber()
+ else:
+ self.url_grabber = url_grabber
def list_builds_since(self, timestamp):
'''Return a list of new builds since the given timestamp'''
- return self.listBuilds(completeAfter=timestamp)
+ return self.kojiclient.listBuilds(completeAfter=timestamp)
def list_tags(self, nvr):
'''Return a list of tags applied to the package with the given nvr'''
- return [t['name'] for t in self.listTags(nvr)]
+ return [t['name'] for t in self.kojiclient.listTags(nvr)]
def tag_history(self, nvr):
'''Returns a list of every tag ever applied to the given nvr'''
- return [t['tag_name'] for t in self.tagHistory(build=nvr)]
+ return [t['tag_name'] for t in self.kojiclient.tagHistory(build=nvr)]
def latest_by_tag(self, tag, pkgname, max_evr=None):
'''Get the latest package for the given name in the given tag. If you
@@ -56,7 +70,7 @@ class SimpleKojiClientSession(koji.ClientSession):
max_evr = (0, max_evr[1], max_evr[2])
if max_evr:
- pkgs = self.listTagged(tag, package=pkgname)
+ pkgs = self.kojiclient.listTagged(tag, package=pkgname)
# sort the packages from highest EVR to lowest
pkgs.sort(cmp=lambda x, y: compareEVR(x, y), reverse=True)
for pkg in pkgs[:]:
@@ -68,19 +82,19 @@ class SimpleKojiClientSession(koji.ClientSession):
# since packages are sorted, we can stop here
break
else:
- pkgs = self.listTagged(tag, package=pkgname, latest=True)
+ pkgs = self.kojiclient.listTagged(tag, package=pkgname, latest=True)
if pkgs:
# the winner is the first package in list
return pkgs[0]
def build_failed(self, nvr):
- return (self.getBuild(nvr)['state'] > 1)
+ return (self.kojiclient.getBuild(nvr)['state'] > 1)
- # Idea taken from the koji CLI
+ # Idea taken from the kojiclient CLI
def ensure_connection(self):
'''Check the connection to koji.'''
try:
- ret = self.getAPIVersion()
+ ret = self.kojiclient.getAPIVersion()
except xmlrpclib.ProtocolError:
print >> sys.stderr, "Unable to connect to server"
sys.exit(2)
@@ -93,7 +107,7 @@ class SimpleKojiClientSession(koji.ClientSession):
timestamp = time.time()
while not builds and (starttime - timestamp < 10000):
timestamp -= 3000
- builds = self.list_builds_since(timestamp)
+ builds = self.kojiclient.list_builds_since(timestamp)
print "Most recent builds: %.0f min ago" % ((starttime-timestamp)/60.0)
return builds
@@ -146,11 +160,11 @@ class SimpleKojiClientSession(koji.ClientSession):
return prev_rlss[0]
def nvr_to_urls(self, nvr, arches=None, debuginfo=False):
- info = self.getBuild(nvr)
- baseurl = '/'.join((pkgurl, info['package_name'],
+ info = self.kojiclient.getBuild(nvr)
+ baseurl = '/'.join((self.pkgurl, info['package_name'],
info['version'], info['release']))
- rpms = self.listRPMs(buildID=info['id'], arches=arches)
+ rpms = self.kojiclient.listRPMs(buildID=info['id'], arches=arches)
if not debuginfo:
rpms = filter(lambda r: not r['name'].endswith('-debuginfo'), rpms)
# XXX option to skip srpms too?
@@ -161,11 +175,11 @@ class SimpleKojiClientSession(koji.ClientSession):
''' Get a list of RPMs existing for specified NVR. All RPMs have 'url'
key added with URL where to download the RPM as the value.'''
- info = self.getBuild(nvr)
- baseurl = '/'.join((pkgurl, info['package_name'],
+ info = self.kojiclient.getBuild(nvr)
+ baseurl = '/'.join((self.pkgurl, info['package_name'],
info['version'], info['release']))
- rpms = self.listRPMs(buildID=info['id'])
+ rpms = self.kojiclient.listRPMs(buildID=info['id'])
if not debuginfo:
rpms = filter(lambda r: not r['name'].endswith('-debuginfo'), rpms)
if not src:
@@ -176,6 +190,19 @@ class SimpleKojiClientSession(koji.ClientSession):
return rpms
+ def get_nvr_rpms(self, nvr, rpm_dir, arches=None, debuginfo=None):
+ ''' Retrieve the rpms associated with an nvr into the specified
+ directory. Return the local filenames of the grabbed rpms
+ '''
+
+ rpm_urls = self.nvr_to_urls(nvr, arches=arches, debuginfo=debuginfo)
+ rpm_files = []
+ for url in rpm_urls:
+ local_file = os.path.join(rpm_dir, os.path.basename(url))
+ rpm_file = self.url_grabber.urlgrab(url, local_file)
+ rpm_files.append(rpm_file)
+ return rpm_files
+
def compareEVR(nvr1, nvr2):
''' Compare EVR from two NVR objects. '''
diff --git a/tests/initscripts/initscripts.py b/tests/initscripts/initscripts.py
index 2261ceb..69a49ba 100644
--- a/tests/initscripts/initscripts.py
+++ b/tests/initscripts/initscripts.py
@@ -140,16 +140,9 @@ class initscripts(AutoQATest):
#install packages from koji
koji = autoqa.koji_utils.SimpleKojiClientSession()
- pkgurls = koji.nvr_to_urls(nvr, arches = os.uname()[-1])
- rpms = []
print "Saving RPMs to %s" % self.rpmdir
- #download packages
- for p in pkgurls:
- # fetch package to rpmdir
- print "Grabbing %s" % p
- localfile = os.path.join(self.rpmdir, os.path.basename(p))
- autoqa.util.grabber.urlgrab(p, localfile)
- rpms.append(localfile)
+ rpms = koji.get_nvr_rpms(nvr, self.rpmdir, arches = os.uname()[-1])
+
#and install them
cmd = "yum -y --nogpgcheck localinstall %s" % " ".join(rpms)
utils.system_output(cmd)
diff --git a/tests/rpmlint/rpmlint.py b/tests/rpmlint/rpmlint.py
index 73d798f..3997485 100644
--- a/tests/rpmlint/rpmlint.py
+++ b/tests/rpmlint/rpmlint.py
@@ -74,12 +74,8 @@ class rpmlint(AutoQATest):
os.remove(os.path.join(self.rpmdir, rpm))
# download packages
- pkgurls = koji.nvr_to_urls(nvr)
print "Saving RPMs to %s" % self.rpmdir
- for p in pkgurls:
- print "Grabbing %s" % p
- localfile = os.path.join(self.rpmdir, os.path.basename(p))
- autoqa.util.grabber.urlgrab(p, localfile)
+ koji.get_nvr_rpms(nvr, self.rpmdir)
# run rpmlint
cmd = 'rpmlint %s' % self.rpmdir
13 years, 3 months
[AutoQA] #246: Add temporary hack for test re-scheduling
by fedora-badges
#246: Add temporary hack for test re-scheduling
--------------------+-------------------------------------------------------
Reporter: kparal | Owner:
Type: task | Status: new
Priority: major | Milestone: 0.4.4
Component: core | Keywords:
--------------------+-------------------------------------------------------
Until we have a proper support for test re-scheduling (ticket #245) we
need some temporary hack to enable test re-scheduling in most common
cases.
We plan to have upgradepath and depcheck sending comments to Bodhi. There
is probably no problem with depcheck, because it re-evaluates the whole
contents of -pending tag on its every update. But there are some issues
with upgradepath, one use case is described in ticket #245.
We need to:
1. get a list of use cases for which we need to reschedule upgradepath or
depcheck
2. inquire whether Bodhi changes timestamp (or whatever) of the updates
in those cases (i.e. we would detect it and run tests again properly even
with our current watcher implementation)
3. in the remaining cases decide what to do with it. For example we can
make temporary upgradepath behave the same way as depcheck does, i.e. test
all builds in -updates-pending for every update of that tag. Because we
will have Bodhi comment duplication prevention, it could work quite fine.
--
Ticket URL: <https://fedorahosted.org/autoqa/ticket/246>
AutoQA <http://autoqa.fedorahosted.org>
Automated QA project
13 years, 3 months
Help needed on participating AutoQA
by Alfred
Hi everyone,
I'm a 3rd year college student of computer study and an intermediate
level Linux user. I'm interested in participating the fedora AutoQA. I
have read the posts in the mailing list and the AutoQA wiki page
(http://fedoraproject.org/wiki/AutoQA), but I still have no idea of what
test I can write about, or how to contribute.
Could anybody suggest some project or some more detailed information on
how to start?
Thank you in advance for your advice.
Alfred
13 years, 3 months