mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-15 20:41:31 +00:00
run-autopkgtest: Add --trigger option
This commit is contained in:
parent
2aa0948250
commit
b869202457
@ -4,6 +4,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
|
|
||||||
import kombu
|
import kombu
|
||||||
|
|
||||||
@ -22,6 +23,9 @@ def parse_args():
|
|||||||
parser.add_argument('-a', '--architecture', action='append', default=[],
|
parser.add_argument('-a', '--architecture', action='append', default=[],
|
||||||
help='Only run test(s) on given architecture name(s). '
|
help='Only run test(s) on given architecture name(s). '
|
||||||
'Can be specified multiple times (default: all).')
|
'Can be specified multiple times (default: all).')
|
||||||
|
parser.add_argument('--trigger', action='append', default=[],
|
||||||
|
help='Add triggering package to request. '
|
||||||
|
'Can be specified multiple times.')
|
||||||
parser.add_argument('package', nargs='+',
|
parser.add_argument('package', nargs='+',
|
||||||
help='Source package name(s) whose tests to run.')
|
help='Source package name(s) whose tests to run.')
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
@ -45,6 +49,11 @@ if __name__ == '__main__':
|
|||||||
if not args.architecture:
|
if not args.architecture:
|
||||||
args.architecture = config.adt_arches.split()
|
args.architecture = config.adt_arches.split()
|
||||||
|
|
||||||
|
if args.trigger:
|
||||||
|
params = '\n' + json.dumps({'triggers': args.trigger})
|
||||||
|
else:
|
||||||
|
params = ''
|
||||||
|
|
||||||
with kombu.Connection(config.adt_amqp) as conn:
|
with kombu.Connection(config.adt_amqp) as conn:
|
||||||
for arch in args.architecture:
|
for arch in args.architecture:
|
||||||
# don't use SimpleQueue here as it always declares queues;
|
# don't use SimpleQueue here as it always declares queues;
|
||||||
@ -52,4 +61,4 @@ if __name__ == '__main__':
|
|||||||
with kombu.Producer(conn, routing_key='debci-%s-%s' % (args.series, arch),
|
with kombu.Producer(conn, routing_key='debci-%s-%s' % (args.series, arch),
|
||||||
auto_declare=False) as p:
|
auto_declare=False) as p:
|
||||||
for pkg in args.package:
|
for pkg in args.package:
|
||||||
p.publish(pkg)
|
p.publish(pkg + params)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user