Merge lp:~cprov/britney/boottest-double-blocking into lp:~ubuntu-release/britney/britney2-ubuntu

Proposed by Celso Providelo
Status: Merged
Merged at revision: 432
Proposed branch: lp:~cprov/britney/boottest-double-blocking
Merge into: lp:~ubuntu-release/britney/britney2-ubuntu
Diff against target: 112 lines (+53/-8)
2 files modified
britney.py (+8/-6)
tests/test_boottest.py (+45/-2)
To merge this branch: bzr merge lp:~cprov/britney/boottest-double-blocking
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Vincent Ladeuil (community) Approve
Ubuntu Release Team Pending
Review via email: mp+250444@code.launchpad.net

Description of the change

Fixing BootTest criteria to stop doubling-blocking package promotion, as reported in:

https://trello.com/c/SxBZD8kN/37-1-boottest-get-a-review-for-britney-boottest-testing-criteria-shared-branch

If an source was already blocked by any previous criteria (autopkgtest) it does not need to be blocked again by BootTest (although boottest job and status will continue to be updated).

To post a comment you must log in.
432. By Celso Providelo

Test ADT & BootTest criteria running simultaneously. Fixed minor issue related to doubling-blocking promotions.

433. By Celso Providelo

Only enable BOOTTEST for testing, so britney.conf is safe on trunk.

Revision history for this message
Vincent Ladeuil (vila) wrote :

One more test with adt passing and autopkgtest running should be even closer to the issue we encounter in production iiuc.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Bah, hit the button before voting.

I would be more comfortable with the added test but I think the existing one is already providing us with a way to reproduce issues in that area anyway.

review: Approve
Revision history for this message
Celso Providelo (cprov) wrote :

Vincent,

Thanks for the review. We can add more tests exercising the production environment (adt + boottest), perhaps operating only on the happy-path. However in order to reproduce the double-blocking error adt and boottest have to block the promotion in question.

Revision history for this message
Vincent Ladeuil (vila) wrote :

> However in order to reproduce the double-blocking error adt and boottest have
> to block the promotion in question.

OIC ! Thanks for the clarification I misunderstood the meaning of the tests indeed.

Revision history for this message
Colin Watson (cjwatson) wrote :

I think you should still add the boottest excuse; so move excuse.addreason("boottest") outside the excuse.is_valid test, but still within the status not in BootTest.VALID_STATUSES test.

review: Needs Fixing
434. By Celso Providelo

Add 'boottest' excuse failure reason when it has failed even if the previous tests had already failed.

Revision history for this message
Celso Providelo (cprov) wrote :

Colin,

It make sense, fix added in r434. Thanks.

Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'britney.py'
--- britney.py 2015-02-10 20:56:35 +0000
+++ britney.py 2015-02-20 16:02:19 +0000
@@ -1973,14 +1973,16 @@
1973 "%s" % (excuse.name, excuse.ver[1],1973 "%s" % (excuse.name, excuse.ver[1],
1974 forces[0].user))1974 forces[0].user))
1975 continue1975 continue
1976 # Block promotion if any boottests attempt has failed or1976 # Block promotion if the excuse is still valid (adt tests
1977 # still in progress.1977 # passed) but the boottests attempt has failed or still in
1978 # progress.
1978 if status not in BootTest.VALID_STATUSES:1979 if status not in BootTest.VALID_STATUSES:
1979 excuse.addhtml("Not considered")
1980 excuse.addreason("boottest")1980 excuse.addreason("boottest")
1981 excuse.is_valid = False1981 if excuse.is_valid:
1982 upgrade_me.remove(excuse.name)1982 excuse.is_valid = False
1983 unconsidered.append(excuse.name)1983 excuse.addhtml("Not considered")
1984 upgrade_me.remove(excuse.name)
1985 unconsidered.append(excuse.name)
19841986
1985 # invalidate impossible excuses1987 # invalidate impossible excuses
1986 for e in self.excuses:1988 for e in self.excuses:
19871989
=== modified file 'tests/test_boottest.py'
--- tests/test_boottest.py 2015-02-11 15:41:43 +0000
+++ tests/test_boottest.py 2015-02-20 16:02:19 +0000
@@ -129,6 +129,9 @@
129 # Disable autopkgtests.129 # Disable autopkgtests.
130 new_config = original_config.replace(130 new_config = original_config.replace(
131 'ADT_ENABLE = yes', 'ADT_ENABLE = no')131 'ADT_ENABLE = yes', 'ADT_ENABLE = no')
132 # Enable boottest.
133 new_config = new_config.replace(
134 'BOOTTEST_ENABLE = no', 'BOOTTEST_ENABLE = yes')
132 # Disable TouchManifest auto-fetching.135 # Disable TouchManifest auto-fetching.
133 new_config = new_config.replace(136 new_config = new_config.replace(
134 'BOOTTEST_FETCH = yes', 'BOOTTEST_FETCH = no')137 'BOOTTEST_FETCH = yes', 'BOOTTEST_FETCH = no')
@@ -151,7 +154,8 @@
151 self.create_manifest([154 self.create_manifest([
152 'green 1.0',155 'green 1.0',
153 'pyqt5:armhf 1.0',156 'pyqt5:armhf 1.0',
154 'signon 1.0'157 'signon 1.0',
158 'purple 1.1',
155 ])159 ])
156160
157 def create_manifest(self, lines):161 def create_manifest(self, lines):
@@ -165,7 +169,8 @@
165 """Create a stub version of boottest-britney script."""169 """Create a stub version of boottest-britney script."""
166 script_path = os.path.expanduser(170 script_path = os.path.expanduser(
167 "~/auto-package-testing/jenkins/boottest-britney")171 "~/auto-package-testing/jenkins/boottest-britney")
168 os.makedirs(os.path.dirname(script_path))172 if not os.path.exists(os.path.dirname(script_path)):
173 os.makedirs(os.path.dirname(script_path))
169 with open(script_path, 'w') as f:174 with open(script_path, 'w') as f:
170 f.write('''#!%(py)s175 f.write('''#!%(py)s
171import argparse176import argparse
@@ -178,6 +183,7 @@
178pyqt5-src 1.1~beta PASS183pyqt5-src 1.1~beta PASS
179pyqt5-src 1.1 FAIL184pyqt5-src 1.1 FAIL
180signon 1.1 PASS185signon 1.1 PASS
186purple 1.1 RUNNING
181"""187"""
182188
183def request():189def request():
@@ -405,6 +411,43 @@
405 r'<li>missing build on .*>armhf</a>: pyqt5 \(from .*>1</a>\)',411 r'<li>missing build on .*>armhf</a>: pyqt5 \(from .*>1</a>\)',
406 '<li>Not considered'])412 '<li>Not considered'])
407413
414 def test_with_adt(self):
415 # Boottest can run simultaneously with autopkgtest (adt).
416
417 # Enable ADT in britney configuration.
418 with open(self.britney_conf, 'r') as fp:
419 original_config = fp.read()
420 new_config = original_config.replace(
421 'ADT_ENABLE = no', 'ADT_ENABLE = yes')
422 with open(self.britney_conf, 'w') as fp:
423 fp.write(new_config)
424
425 # Create a fake 'adt-britney' that reports a RUNNING job for
426 # the testing source ('purple_1.1').
427 script_path = os.path.expanduser(
428 "~/auto-package-testing/jenkins/adt-britney")
429 os.makedirs(os.path.dirname(script_path))
430 with open(script_path, 'w') as f:
431 f.write('''#!/bin/sh -e
432mkdir -p ~/proposed-migration/autopkgtest/work
433touch ~/proposed-migration/autopkgtest/work/adt.request.series
434echo "purple 1.1 RUNNING purple 1.1" >> ~/proposed-migration/autopkgtest/work/adt.result.series''')
435 os.chmod(script_path, 0o755)
436
437 # Britney blocks testing source promotion while ADT and boottest
438 # are running.
439 self.data.add('purple', False, {'Version': '1.0'})
440 context = [
441 ('purple', {'Version': '1.1'}),
442 ]
443 self.do_test(
444 context,
445 [r'\bpurple\b.*>1.0<.* to .*>1.1<',
446 '<li>autopkgtest for purple 1.1: {}'.format(
447 boottest.BootTest.EXCUSE_LABELS['RUNNING']),
448 '<li>Boottest result: {}'.format(
449 boottest.BootTest.EXCUSE_LABELS['RUNNING']),
450 '<li>Not considered'])
408451
409452
410if __name__ == '__main__':453if __name__ == '__main__':

Subscribers

People subscribed via source and target branches