~laney/ubuntu-archive-tools/r-a-r-improvements

« back to all changes in this revision

Viewing changes to retry-autopkgtest-regressions

  • Committer: Iain Lane
  • Date: 2019-02-04 11:45:52 UTC
  • Revision ID: iain@orangesquash.org.uk-20190204114552-4fe4zyvry3d2mc0q
retry-autopkgtest-regressions: Add support for limiting by arch

Pass --arch foo or -a foo as many times as you want.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
    parser.add_argument('--blocks',
74
74
                        help='rerun only those tests that were triggered '
75
75
                        'by the named package')
 
76
    parser.add_argument('--arch', '-a', type=str, metavar='ARCH',
 
77
                        action='append', help='only show results for ARCH '
 
78
                        '(give multiple times for multiple arches)')
76
79
    parser.add_argument('--no-proposed', action='store_true',
77
80
                        help='run tests against release+updates instead of '
78
81
                        'against proposed, to re-establish a baseline for the '
92
95
 
93
96
 
94
97
def get_regressions(excuses_url, release, retry_state, min_age, max_age,
95
 
                    blocks, no_proposed, only_unknown=False):
 
98
                    blocks, no_proposed, arches=None, only_unknown=False):
96
99
    '''Return dictionary with regressions
97
100
 
98
101
    Return dict: release → pkg → arch → [trigger, ...]
160
163
                        continue
161
164
                except UnboundLocalError:  # no version
162
165
                    pass
 
166
 
 
167
                if arches and arch not in arches:
 
168
                    continue
 
169
 
163
170
                if state[0] == retry_state:
164
171
                    regressions.setdefault(release, {}).setdefault(
165
172
                        pkg, {}).setdefault(arch, []).append(trigger)
191
198
    excuses_url = 'http://people.canonical.com/~ubuntu-archive/proposed-migration/%s/update_excuses.yaml' % args.series
192
199
regressions = get_regressions(excuses_url, args.series, args.state,
193
200
                              args.min_age, args.max_age, args.blocks,
194
 
                              args.no_proposed, args.only_unknown)
 
201
                              args.no_proposed, args.arch, args.only_unknown)
195
202
 
196
203
for release, pkgmap in regressions.items():
197
204
    for pkg, archmap in pkgmap.items():