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
1=== modified file 'britney.py'
2--- britney.py 2015-02-10 20:56:35 +0000
3+++ britney.py 2015-02-20 16:02:19 +0000
4@@ -1973,14 +1973,16 @@
5 "%s" % (excuse.name, excuse.ver[1],
6 forces[0].user))
7 continue
8- # Block promotion if any boottests attempt has failed or
9- # still in progress.
10+ # Block promotion if the excuse is still valid (adt tests
11+ # passed) but the boottests attempt has failed or still in
12+ # progress.
13 if status not in BootTest.VALID_STATUSES:
14- excuse.addhtml("Not considered")
15 excuse.addreason("boottest")
16- excuse.is_valid = False
17- upgrade_me.remove(excuse.name)
18- unconsidered.append(excuse.name)
19+ if excuse.is_valid:
20+ excuse.is_valid = False
21+ excuse.addhtml("Not considered")
22+ upgrade_me.remove(excuse.name)
23+ unconsidered.append(excuse.name)
24
25 # invalidate impossible excuses
26 for e in self.excuses:
27
28=== modified file 'tests/test_boottest.py'
29--- tests/test_boottest.py 2015-02-11 15:41:43 +0000
30+++ tests/test_boottest.py 2015-02-20 16:02:19 +0000
31@@ -129,6 +129,9 @@
32 # Disable autopkgtests.
33 new_config = original_config.replace(
34 'ADT_ENABLE = yes', 'ADT_ENABLE = no')
35+ # Enable boottest.
36+ new_config = new_config.replace(
37+ 'BOOTTEST_ENABLE = no', 'BOOTTEST_ENABLE = yes')
38 # Disable TouchManifest auto-fetching.
39 new_config = new_config.replace(
40 'BOOTTEST_FETCH = yes', 'BOOTTEST_FETCH = no')
41@@ -151,7 +154,8 @@
42 self.create_manifest([
43 'green 1.0',
44 'pyqt5:armhf 1.0',
45- 'signon 1.0'
46+ 'signon 1.0',
47+ 'purple 1.1',
48 ])
49
50 def create_manifest(self, lines):
51@@ -165,7 +169,8 @@
52 """Create a stub version of boottest-britney script."""
53 script_path = os.path.expanduser(
54 "~/auto-package-testing/jenkins/boottest-britney")
55- os.makedirs(os.path.dirname(script_path))
56+ if not os.path.exists(os.path.dirname(script_path)):
57+ os.makedirs(os.path.dirname(script_path))
58 with open(script_path, 'w') as f:
59 f.write('''#!%(py)s
60 import argparse
61@@ -178,6 +183,7 @@
62 pyqt5-src 1.1~beta PASS
63 pyqt5-src 1.1 FAIL
64 signon 1.1 PASS
65+purple 1.1 RUNNING
66 """
67
68 def request():
69@@ -405,6 +411,43 @@
70 r'<li>missing build on .*>armhf</a>: pyqt5 \(from .*>1</a>\)',
71 '<li>Not considered'])
72
73+ def test_with_adt(self):
74+ # Boottest can run simultaneously with autopkgtest (adt).
75+
76+ # Enable ADT in britney configuration.
77+ with open(self.britney_conf, 'r') as fp:
78+ original_config = fp.read()
79+ new_config = original_config.replace(
80+ 'ADT_ENABLE = no', 'ADT_ENABLE = yes')
81+ with open(self.britney_conf, 'w') as fp:
82+ fp.write(new_config)
83+
84+ # Create a fake 'adt-britney' that reports a RUNNING job for
85+ # the testing source ('purple_1.1').
86+ script_path = os.path.expanduser(
87+ "~/auto-package-testing/jenkins/adt-britney")
88+ os.makedirs(os.path.dirname(script_path))
89+ with open(script_path, 'w') as f:
90+ f.write('''#!/bin/sh -e
91+mkdir -p ~/proposed-migration/autopkgtest/work
92+touch ~/proposed-migration/autopkgtest/work/adt.request.series
93+echo "purple 1.1 RUNNING purple 1.1" >> ~/proposed-migration/autopkgtest/work/adt.result.series''')
94+ os.chmod(script_path, 0o755)
95+
96+ # Britney blocks testing source promotion while ADT and boottest
97+ # are running.
98+ self.data.add('purple', False, {'Version': '1.0'})
99+ context = [
100+ ('purple', {'Version': '1.1'}),
101+ ]
102+ self.do_test(
103+ context,
104+ [r'\bpurple\b.*>1.0<.* to .*>1.1<',
105+ '<li>autopkgtest for purple 1.1: {}'.format(
106+ boottest.BootTest.EXCUSE_LABELS['RUNNING']),
107+ '<li>Boottest result: {}'.format(
108+ boottest.BootTest.EXCUSE_LABELS['RUNNING']),
109+ '<li>Not considered'])
110
111
112 if __name__ == '__main__':

Subscribers

People subscribed via source and target branches