autopkgtest: Add back hack to only trigger selected tests for gcc-N

We might want to consider doing this in a more generic way.
ubuntu/dry-run
Iain Lane 5 years ago
parent 96715dcd2b
commit e871a3993d

@ -651,6 +651,29 @@ class AutopkgtestPolicy(BasePolicy):
tests = [] tests = []
# gcc-N triggers tons of tests via libgcc1, but this is mostly in vain:
# gcc already tests itself during build, and it is being used from
# -proposed, so holding it back on a dozen unrelated test failures
# serves no purpose. Just check some key packages which actually use
# gcc during the test, and doxygen as an example for a libgcc user.
if src.startswith('gcc-'):
if re.match(r'gcc-\d$', src) or src == 'gcc-defaults':
# add gcc's own tests, if it has any
srcinfo = source_suite.sources[src]
if 'autopkgtest' in srcinfo.testsuite:
tests.append((src, ver))
for test in ['binutils', 'fglrx-installer', 'doxygen', 'linux']:
try:
tests.append((test, sources_info[test].version))
except KeyError:
# no package in that series? *shrug*, then not (mostly for testing)
pass
return tests
else:
# for other compilers such as gcc-snapshot etc. we don't need
# to trigger anything
return []
# Debian doesn't have linux-meta, but Ubuntu does # Debian doesn't have linux-meta, but Ubuntu does
# for linux themselves we don't want to trigger tests -- these should # for linux themselves we don't want to trigger tests -- these should
# all come from linux-meta*. A new kernel ABI without a corresponding # all come from linux-meta*. A new kernel ABI without a corresponding

@ -2411,6 +2411,24 @@ class AT(TestAutopkgtestBase):
# Tests for special-cased packages # Tests for special-cased packages
################################################################ ################################################################
def test_gcc(self):
'''gcc only triggers some key packages'''
self.data.add('binutils', False, {}, testsuite='autopkgtest')
self.data.add('linux', False, {}, testsuite='autopkgtest')
self.data.add('notme', False, {'Depends': 'libgcc1'}, testsuite='autopkgtest')
# binutils has passed before on i386 only, therefore ALWAYSFAIL on amd64
self.swift.set_results({'autopkgtest-testing': {
'testing/i386/b/binutils/20150101_100000@': (0, 'binutils 1', tr('passedbefore/1')),
}})
exc = self.run_it(
[('libgcc1', {'Source': 'gcc-5', 'Version': '2'}, None)],
{'gcc-5': (False, {'binutils': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'RUNNING'},
'linux': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'RUNNING-ALWAYSFAIL'}})})[1]
self.assertNotIn('notme 1', exc['gcc-5']['policy_info']['autopkgtest'])
def test_gcc_hastest(self): def test_gcc_hastest(self):
"""gcc triggers itself when it has a testsuite""" """gcc triggers itself when it has a testsuite"""

Loading…
Cancel
Save