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
diff --git a/scripts/ppa b/scripts/ppa
index fbf65f2..6be138e 100755
--- a/scripts/ppa
+++ b/scripts/ppa
@@ -52,7 +52,7 @@ import time
52import argparse52import argparse
53from inspect import currentframe53from inspect import currentframe
54from textwrap import indent54from textwrap import indent
55from distro_info import UbuntuDistroInfo, DistroDataOutdated55from distro_info import UbuntuDistroInfo
5656
57try:57try:
58 from ruamel import yaml58 from ruamel import yaml
@@ -175,6 +175,7 @@ def add_basic_config_options(parser) -> None:
175 '--displayname',175 '--displayname',
176 dest="displayname",176 dest="displayname",
177 action='store',177 action='store',
178 default=None,
178 help="A short title for the PPA's web page."179 help="A short title for the PPA's web page."
179 )180 )
180181
@@ -183,6 +184,7 @@ def add_basic_config_options(parser) -> None:
183 '--description',184 '--description',
184 dest="description",185 dest="description",
185 action='store',186 action='store',
187 default=None,
186 help="A short description of the archive. URLs will be rendered as links. (See also 'ppa desc'.)"188 help="A short description of the archive. URLs will be rendered as links. (See also 'ppa desc'.)"
187 )189 )
188190
@@ -295,9 +297,11 @@ def create_arg_parser():
295 help="Name of the PPA to show")297 help="Name of the PPA to show")
296 show_parser.add_argument('-a', '--arches', '--arch', '--architectures',298 show_parser.add_argument('-a', '--arches', '--arch', '--architectures',
297 dest="architectures", action='store',299 dest="architectures", action='store',
300 default=None,
298 help="Comma-separated list of hardware architectures to show")301 help="Comma-separated list of hardware architectures to show")
299 show_parser.add_argument('-r', '--releases', '--release',302 show_parser.add_argument('-r', '--releases', '--release',
300 dest="releases", action='store',303 dest="releases", action='store',
304 default=None,
301 help="Comma-separated list of Ubuntu release codenames to show")305 help="Comma-separated list of Ubuntu release codenames to show")
302 show_parser.add_argument('-p', '--packages', '--package',306 show_parser.add_argument('-p', '--packages', '--package',
303 dest="packages", action='store',307 dest="packages", action='store',
@@ -313,6 +317,7 @@ def create_arg_parser():
313 add_global_options(status_parser)317 add_global_options(status_parser)
314 status_parser.add_argument('ppa_name', metavar='ppa-name',318 status_parser.add_argument('ppa_name', metavar='ppa-name',
315 action='store',319 action='store',
320 default=None,
316 help="Name of the PPA to report status of")321 help="Name of the PPA to report status of")
317322
318 # Tests Command323 # Tests Command
@@ -325,18 +330,23 @@ def create_arg_parser():
325 add_global_options(tests_parser)330 add_global_options(tests_parser)
326 tests_parser.add_argument('ppa_name', metavar='ppa-name',331 tests_parser.add_argument('ppa_name', metavar='ppa-name',
327 action='store',332 action='store',
333 default=None,
328 help="Name of the PPA to view tests")334 help="Name of the PPA to view tests")
329 tests_parser.add_argument('-a', '--arches', '--arch', '--architectures',335 tests_parser.add_argument('-a', '--arches', '--arch', '--architectures',
330 dest="architectures", action='store',336 dest="architectures", action='store',
337 default=None,
331 help="Comma-separated list of hardware architectures to include")338 help="Comma-separated list of hardware architectures to include")
332 tests_parser.add_argument('-r', '--releases', '--release',339 tests_parser.add_argument('-r', '--releases', '--release',
333 dest="releases", action='store',340 dest="releases", action='store',
341 default=None,
334 help="Comma-separated list of Ubuntu release codenames to show")342 help="Comma-separated list of Ubuntu release codenames to show")
335 tests_parser.add_argument('-p', '--packages', '--package',343 tests_parser.add_argument('-p', '--packages', '--package',
336 dest="packages", action='store',344 dest="packages", action='store',
345 default=None,
337 help="Comma-separated list of source package names to show")346 help="Comma-separated list of source package names to show")
338 tests_parser.add_argument('-L', '--show-url', '--show-urls',347 tests_parser.add_argument('-L', '--show-url', '--show-urls',
339 dest='show_urls', action='store_true', default=False,348 dest='show_urls', action='store_true',
349 default=False,
340 help="Display unformatted trigger action URLs")350 help="Display unformatted trigger action URLs")
341351
342 # Wait Command352 # Wait Command
@@ -761,14 +771,7 @@ def command_tests(lp, config):
761 releases = config.get('releases', None)771 releases = config.get('releases', None)
762 if releases is None:772 if releases is None:
763 udi = UbuntuDistroInfo()773 udi = UbuntuDistroInfo()
764 try:774 releases = udi.supported()
765 # Show tests only from the current development release
766 releases = [udi.devel()]
767 except DistroDataOutdated as e:
768 # If no development release defined, use the current active release
769 warn(f"Devel release is undefined; assuming stable release instead.")
770 dbg(f"({e})", wrap=72, prefix=' - ', indent=' ')
771 releases = [udi.stable()]
772775
773 packages = config.get('packages', None)776 packages = config.get('packages', None)
774777
@@ -828,9 +831,9 @@ def command_tests(lp, config):
828 trigger_sets.setdefault(trigger, '')831 trigger_sets.setdefault(trigger, '')
829 if config.get("show_urls"):832 if config.get("show_urls"):
830 trigger_sets[trigger] += f" + {result.status_icon} {result}\n"833 trigger_sets[trigger] += f" + {result.status_icon} {result}\n"
834 trigger_sets[trigger] += f" • Log: {result.url}\n"
831 if result.status != 'PASS':835 if result.status != 'PASS':
832 trigger_sets[trigger] += f" • Status: {result.status}\n"836 trigger_sets[trigger] += f" • Status: {result.status}\n"
833 trigger_sets[trigger] += f" • Log: {result.url}\n"
834 for subtest in result.get_subtests():837 for subtest in result.get_subtests():
835 trigger_sets[trigger] += f" • {subtest}\n"838 trigger_sets[trigger] += f" • {subtest}\n"
836 else:839 else:

Subscribers

People subscribed via source and target branches

to all changes: