Merge lp:~vorlon/ubuntu-archive-tools/fancier-autopkgtest-retries into lp:ubuntu-archive-tools

Proposed by Steve Langasek on 2017-12-19
Status: Needs review
Proposed branch: lp:~vorlon/ubuntu-archive-tools/fancier-autopkgtest-retries
Merge into: lp:ubuntu-archive-tools
Diff against target: 67 lines (+20/-4)
1 file modified
retry-autopkgtest-regressions (+20/-4)
To merge this branch: bzr merge lp:~vorlon/ubuntu-archive-tools/fancier-autopkgtest-retries
Reviewer Review Type Date Requested Status
Matthias Klose 2017-12-19 Pending
Ubuntu Package Archive Administrators 2017-12-19 Pending
Review via email: mp+335413@code.launchpad.net
To post a comment you must log in.
1138. By Steve Langasek on 2017-12-19

Add --no-proposed option to retry-autopkgtest-regressions

This option permutes the triggers on retry to run each test against its own
package, instead of against the original triggering package, to let us get a
baseline for the autopkgtest against the release.

This relies on information within update_excuses itself to know what the
right substitute trigger will be.

Unmerged revisions

1138. By Steve Langasek on 2017-12-19

Add --no-proposed option to retry-autopkgtest-regressions

This option permutes the triggers on retry to run each test against its own
package, instead of against the original triggering package, to let us get a
baseline for the autopkgtest against the release.

This relies on information within update_excuses itself to know what the
right substitute trigger will be.

1137. By Steve Langasek on 2017-12-19

Add --blocks option to retry-autopkgtest-regressions

This will filter the list of tests to only those which were triggered by the
named package. This is a useful optimization over having to assemble your
own grep/sed pipeline for this common case.

It is also a necessary first step towards being able to support triggering
retries of failed tests against the release pocket, because in that case the
original triggering package name would no longer appear in the output and
you wouldn't be able to filter with grep.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'retry-autopkgtest-regressions'
2--- retry-autopkgtest-regressions 2017-10-25 07:45:54 +0000
3+++ retry-autopkgtest-regressions 2017-12-19 20:52:57 +0000
4@@ -22,6 +22,7 @@
5 import urllib.request
6 import urllib.parse
7 import argparse
8+import re
9 import yaml
10 import json
11
12@@ -57,12 +58,21 @@
13 parser.add_argument('--min-age', type=float, metavar='DAYS',
14 help='only consider candiates which are at least '
15 'this number of days old (float allowed)')
16+ parser.add_argument('--blocks',
17+ help='rerun only those tests that were triggered '
18+ 'by the named package')
19+ parser.add_argument('--no-proposed', action='store_true',
20+ help='run tests against release+updates instead of '
21+ 'against proposed, to re-establish a baseline for the '
22+ 'test. This currently only works for packages that '
23+ 'do not themselves have a newer version in proposed.')
24 args = parser.parse_args()
25
26 return args
27
28
29-def get_regressions(excuses_url, release, retry_state, min_age, max_age):
30+def get_regressions(excuses_url, release, retry_state, min_age, max_age,
31+ blocks, no_proposed):
32 '''Return dictionary with regressions
33
34 Return dict: release → pkg → arch → [trigger, ...]
35@@ -72,6 +82,8 @@
36 excuses = yaml.load(f)
37 regressions = {}
38 for excuse in excuses['sources']:
39+ if blocks and blocks != excuse['source']:
40+ continue
41 try:
42 age = excuse['policy_info']['age']['current-age']
43 except KeyError:
44@@ -83,8 +95,11 @@
45 if max_age is not None and age is not None and age > max_age:
46 break
47 for pkg, archinfo in excuse.get('policy_info', {}).get('autopkgtest', {}).items():
48- pkg = pkg.split('/')[0].split()[0] # strip off version (either / or space separated)
49- trigger = excuse['source'] + '/' + excuse['new-version']
50+ pkg, pkg_ver = re.split('[ /]+', pkg, 1) # split off version (either / or space separated)
51+ if no_proposed:
52+ trigger = pkg + '/' + pkg_ver
53+ else:
54+ trigger = excuse['source'] + '/' + excuse['new-version']
55 for arch, state in archinfo.items():
56 if state[0] == retry_state:
57 regressions.setdefault(release, {}).setdefault(
58@@ -118,7 +133,8 @@
59 else:
60 excuses_url = 'http://people.canonical.com/~ubuntu-archive/proposed-migration/%s/update_excuses.yaml' % args.series
61 regressions = get_regressions(excuses_url, args.series, args.state,
62- args.min_age, args.max_age)
63+ args.min_age, args.max_age, args.blocks,
64+ args.no_proposed)
65
66 for release, pkgmap in regressions.items():
67 for pkg, archmap in pkgmap.items():

Subscribers

People subscribed via source and target branches