Use current reverse dep version instead of None/-

This makes tracking test results easier and removes some special cases.
bzr-import-20160707
Martin Pitt 10 years ago
parent ded6912443
commit bf470c6da0

@ -28,7 +28,7 @@ import apt_pkg
import kombu import kombu
from consts import (AUTOPKGTEST, BINARIES, RDEPENDS, SOURCE) from consts import (AUTOPKGTEST, BINARIES, RDEPENDS, SOURCE, VERSION)
adt_britney = os.path.expanduser("~/auto-package-testing/jenkins/adt-britney") adt_britney = os.path.expanduser("~/auto-package-testing/jenkins/adt-britney")
@ -109,7 +109,7 @@ class AutoPackageTest(object):
if sources_info[rdep_src][AUTOPKGTEST]: if sources_info[rdep_src][AUTOPKGTEST]:
if rdep_src not in reported_pkgs: if rdep_src not in reported_pkgs:
# we don't care about the version of rdep # we don't care about the version of rdep
yield (rdep_src, None) yield (rdep_src, sources_info[rdep_src][VERSION])
reported_pkgs.add(rdep_src) reported_pkgs.add(rdep_src)
# #
@ -141,10 +141,6 @@ class AutoPackageTest(object):
self.log_error('ignoring malformed line in %s: %s' % self.log_error('ignoring malformed line in %s: %s' %
(self.pending_tests_file, l)) (self.pending_tests_file, l))
continue continue
if ver == '-':
ver = None
if trigver == '-':
trigver = None
self.pending_tests.setdefault(src, {}).setdefault( self.pending_tests.setdefault(src, {}).setdefault(
ver, set()).add((trigsrc, trigver)) ver, set()).add((trigsrc, trigver))
self.log_verbose('Read pending requested tests from %s: %s' % self.log_verbose('Read pending requested tests from %s: %s' %
@ -168,10 +164,6 @@ class AutoPackageTest(object):
for src in sorted(self.pending_tests): for src in sorted(self.pending_tests):
for ver in sorted(self.pending_tests[src]): for ver in sorted(self.pending_tests[src]):
for (trigsrc, trigver) in sorted(self.pending_tests[src][ver]): for (trigsrc, trigver) in sorted(self.pending_tests[src][ver]):
if ver is None:
ver = '-'
if trigver is None:
trigver = '-'
f.write('%s %s %s %s\n' % (src, ver, trigsrc, trigver)) f.write('%s %s %s %s\n' % (src, ver, trigsrc, trigver))
os.rename(self.pending_tests_file + '.new', self.pending_tests_file) os.rename(self.pending_tests_file + '.new', self.pending_tests_file)
self.log_verbose('Updated pending requested tests in %s' % self.log_verbose('Updated pending requested tests in %s' %
@ -182,8 +174,6 @@ class AutoPackageTest(object):
This will only be done if that test wasn't already requested in a This will only be done if that test wasn't already requested in a
previous run, i. e. it is already in self.pending_tests. previous run, i. e. it is already in self.pending_tests.
versions can be None if you don't care about the particular version.
''' '''
if (trigsrc, trigver) in self.pending_tests.get(src, {}).get(ver, set()): if (trigsrc, trigver) in self.pending_tests.get(src, {}).get(ver, set()):
self.log_verbose('test %s/%s for %s/%s is already pending, not queueing' % self.log_verbose('test %s/%s for %s/%s is already pending, not queueing' %

@ -126,9 +126,9 @@ echo "$@" >> /%s/adt-britney.log ''' % self.data.path)
os.unlink(self.fake_amqp) os.unlink(self.fake_amqp)
# ... and that they get recorded as pending # ... and that they get recorded as pending
expected_pending = '''darkgreen - green 2 expected_pending = '''darkgreen 1 green 2
green 2 green 2 green 2 green 2
lightgreen - green 2 lightgreen 1 green 2
''' '''
self.assertEqual(self.pending_requests, expected_pending) self.assertEqual(self.pending_requests, expected_pending)
@ -160,13 +160,12 @@ lightgreen - green 2
])) ]))
os.unlink(self.fake_amqp) os.unlink(self.fake_amqp)
expected_pending = '''darkgreen - green 2 # ... and that they get recorded as pending
expected_pending = '''darkgreen 1 green 2
green 2 green 2 green 2 green 2
lightgreen - green 2 lightgreen 2 green 2
lightgreen 2 lightgreen 2 lightgreen 2 lightgreen 2
''' '''
# ... and that they get recorded as pending
self.assertEqual(self.pending_requests, expected_pending) self.assertEqual(self.pending_requests, expected_pending)
def test_no_amqp_config(self): def test_no_amqp_config(self):

Loading…
Cancel
Save