mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-10 14:07:29 +00:00
Skip second-stage upgrade testing if UPGRADE_OUTPUT option is absent or empty
This is useful to speed up britney in dry run mode, if we are only interested in builds and package tests.
This commit is contained in:
parent
7fc34b1ab6
commit
2b61398004
@ -3335,6 +3335,13 @@ class Britney(object):
|
||||
else:
|
||||
self.upgrade_me = self.options.actions.split()
|
||||
|
||||
# skip upgrade testing if UPGRADE_OUTPUT option is absent or empty
|
||||
try:
|
||||
if not self.options.upgrade_output:
|
||||
return
|
||||
except AttributeError:
|
||||
return
|
||||
|
||||
ensuredir(os.path.dirname(self.options.upgrade_output))
|
||||
with open(self.options.upgrade_output, 'w', encoding='utf-8') as f:
|
||||
self.__output = f
|
||||
|
@ -169,6 +169,11 @@ class T(TestBase):
|
||||
self.assertEqual(self.pending_requests, {})
|
||||
self.assertEqual(self.amqp_requests, set())
|
||||
|
||||
with open(os.path.join(self.data.path, 'output', 'series', 'output.txt')) as f:
|
||||
upgrade_out = f.read()
|
||||
self.assertNotIn('accepted:', upgrade_out)
|
||||
self.assertIn('SUCCESS (0/0)', upgrade_out)
|
||||
|
||||
def test_no_wait_for_always_failed_test(self):
|
||||
'''We do not need to wait for results for tests which have always failed'''
|
||||
|
||||
@ -202,6 +207,11 @@ class T(TestBase):
|
||||
set(['debci-series-amd64:darkgreen {"triggers": ["darkgreen/2"]}',
|
||||
'debci-series-i386:darkgreen {"triggers": ["darkgreen/2"]}']))
|
||||
|
||||
with open(os.path.join(self.data.path, 'output', 'series', 'output.txt')) as f:
|
||||
upgrade_out = f.read()
|
||||
self.assertIn('accepted: darkgreen', upgrade_out)
|
||||
self.assertIn('SUCCESS (1/0)', upgrade_out)
|
||||
|
||||
def test_multi_rdepends_with_tests_all_running(self):
|
||||
'''Multiple reverse dependencies with tests (all running)'''
|
||||
|
||||
@ -1578,6 +1588,19 @@ class T(TestBase):
|
||||
self.assertEqual(self.amqp_requests, set())
|
||||
self.assertEqual(self.pending_requests, {})
|
||||
|
||||
def test_disable_upgrade_tester(self):
|
||||
'''Run without second stage upgrade tester'''
|
||||
|
||||
for line in fileinput.input(self.britney_conf, inplace=True):
|
||||
if not line.startswith('UPGRADE_OUTPUT'):
|
||||
sys.stdout.write(line)
|
||||
|
||||
self.do_test(
|
||||
[('libgreen1', {'Version': '2', 'Source': 'green', 'Depends': 'libc6'}, 'autopkgtest')],
|
||||
{})[1]
|
||||
|
||||
self.assertFalse(os.path.exists(os.path.join(self.data.path, 'output', 'series', 'output.txt')))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user