Merge ppa-dev-tools:improve-tests-command-argument-behaviors into ppa-dev-tools:main

Proposed by Bryce Harrington
Status: Merged
Merged at revision: 8ca9a4679d89482a53863773c6b9a38cee2510ef
Proposed branch: ppa-dev-tools:improve-tests-command-argument-behaviors
Merge into: ppa-dev-tools:main
Diff against target: 101 lines (+14/-11)
1 file modified
scripts/ppa (+14/-11)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server MOTU reviewers Pending
Canonical Server packageset reviewers Pending
Canonical Server Reporter Pending
Review via email: mp+437237@code.launchpad.net

Description of the change

Three bugfixes for the `ppa tests` command, reported by Brian and Christian.

These changes should be straightforward. Normally I'd include pytest cases with these as well, but I'm working on the `ppa tests` test cases in another branch so will postpone that for now.

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

All three changes LGTM, thanks for continuously improving the tool!

BTW I might have more users for the "reverse dependency based tests" as done by propose migration :-)

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

On Tue, Feb 14, 2023 at 09:30:09AM -0000, Christian Ehrhardt  wrote:
> Review: Approve
>
> All three changes LGTM, thanks for continuously improving the tool!

Thanks, pushed:

To git+ssh://git.launchpad.net/ppa-dev-tools
   321446a..8ca9a46 main -> main

> BTW I might have more users for the "reverse dependency based tests" as done by propose migration :-)

Great!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/ppa b/scripts/ppa
2index fbf65f2..6be138e 100755
3--- a/scripts/ppa
4+++ b/scripts/ppa
5@@ -52,7 +52,7 @@ import time
6 import argparse
7 from inspect import currentframe
8 from textwrap import indent
9-from distro_info import UbuntuDistroInfo, DistroDataOutdated
10+from distro_info import UbuntuDistroInfo
11
12 try:
13 from ruamel import yaml
14@@ -175,6 +175,7 @@ def add_basic_config_options(parser) -> None:
15 '--displayname',
16 dest="displayname",
17 action='store',
18+ default=None,
19 help="A short title for the PPA's web page."
20 )
21
22@@ -183,6 +184,7 @@ def add_basic_config_options(parser) -> None:
23 '--description',
24 dest="description",
25 action='store',
26+ default=None,
27 help="A short description of the archive. URLs will be rendered as links. (See also 'ppa desc'.)"
28 )
29
30@@ -295,9 +297,11 @@ def create_arg_parser():
31 help="Name of the PPA to show")
32 show_parser.add_argument('-a', '--arches', '--arch', '--architectures',
33 dest="architectures", action='store',
34+ default=None,
35 help="Comma-separated list of hardware architectures to show")
36 show_parser.add_argument('-r', '--releases', '--release',
37 dest="releases", action='store',
38+ default=None,
39 help="Comma-separated list of Ubuntu release codenames to show")
40 show_parser.add_argument('-p', '--packages', '--package',
41 dest="packages", action='store',
42@@ -313,6 +317,7 @@ def create_arg_parser():
43 add_global_options(status_parser)
44 status_parser.add_argument('ppa_name', metavar='ppa-name',
45 action='store',
46+ default=None,
47 help="Name of the PPA to report status of")
48
49 # Tests Command
50@@ -325,18 +330,23 @@ def create_arg_parser():
51 add_global_options(tests_parser)
52 tests_parser.add_argument('ppa_name', metavar='ppa-name',
53 action='store',
54+ default=None,
55 help="Name of the PPA to view tests")
56 tests_parser.add_argument('-a', '--arches', '--arch', '--architectures',
57 dest="architectures", action='store',
58+ default=None,
59 help="Comma-separated list of hardware architectures to include")
60 tests_parser.add_argument('-r', '--releases', '--release',
61 dest="releases", action='store',
62+ default=None,
63 help="Comma-separated list of Ubuntu release codenames to show")
64 tests_parser.add_argument('-p', '--packages', '--package',
65 dest="packages", action='store',
66+ default=None,
67 help="Comma-separated list of source package names to show")
68 tests_parser.add_argument('-L', '--show-url', '--show-urls',
69- dest='show_urls', action='store_true', default=False,
70+ dest='show_urls', action='store_true',
71+ default=False,
72 help="Display unformatted trigger action URLs")
73
74 # Wait Command
75@@ -761,14 +771,7 @@ def command_tests(lp, config):
76 releases = config.get('releases', None)
77 if releases is None:
78 udi = UbuntuDistroInfo()
79- try:
80- # Show tests only from the current development release
81- releases = [udi.devel()]
82- except DistroDataOutdated as e:
83- # If no development release defined, use the current active release
84- warn(f"Devel release is undefined; assuming stable release instead.")
85- dbg(f"({e})", wrap=72, prefix=' - ', indent=' ')
86- releases = [udi.stable()]
87+ releases = udi.supported()
88
89 packages = config.get('packages', None)
90
91@@ -828,9 +831,9 @@ def command_tests(lp, config):
92 trigger_sets.setdefault(trigger, '')
93 if config.get("show_urls"):
94 trigger_sets[trigger] += f" + {result.status_icon} {result}\n"
95+ trigger_sets[trigger] += f" • Log: {result.url}\n"
96 if result.status != 'PASS':
97 trigger_sets[trigger] += f" • Status: {result.status}\n"
98- trigger_sets[trigger] += f" • Log: {result.url}\n"
99 for subtest in result.get_subtests():
100 trigger_sets[trigger] += f" • {subtest}\n"
101 else:

Subscribers

People subscribed via source and target branches

to all changes: