Merge ppa-dev-tools:fix-lp1992568-report-common-actions into ppa-dev-tools:main

Proposed by Bryce Harrington
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: 9e080559eef65427f3c92272101ab8f99585fc4c
Proposed branch: ppa-dev-tools:fix-lp1992568-report-common-actions
Merge into: ppa-dev-tools:main
Diff against target: 137 lines (+54/-15)
3 files modified
ppa/ppa.py (+4/-5)
scripts/ppa (+28/-9)
tests/test_scripts_ppa.py (+22/-1)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Ubuntu Server Pending
Canonical Server Reporter Pending
Review via email: mp+431785@code.staging.launchpad.net

Description of the change

A fix for LP: #1992568, which seemed simple enough but I took the opportunity to add a couple command line options --quiet and --architectures, and fixed up --dry-run to actually work properly for the create command.

This also starts adding in test cases for command line options; I'll follow this same style for all future command line option tests, so any thoughts on improvements for the style (or other aspects worth testing) would be of value.

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

Output is indeed better now.
And enough to have a quiet option indeed, thanks for thinking about that.

A few things I thought about you tackled in later commits already.

I consider myself not the best test reviewer, but you miss testing for dry-run.
On the general concept I wanted to ask for more tests on the actual creation but then found tests/test_ppa_group.py which covers that already. So you are good, but while looking there auto-checkers showed me:
  "singleton-comparison: Comparison 'args.debug == True' should be 'args.debug is True' if checking for the singleton value True, or 'args.debug' if testing for truthiness"

Maybe not for now (and it always depends which checkers style you want to follow) but a potential improvement later on?

Some minor improvement suggested inline.
But generally +1

@all - if one has deeper python test thoughts chime in.
@Bryce - maybe I should bring it up in the Pro/CI standups which are more python heavy.

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I've pinged the other teams to consider having a look at the testing in general.

Revision history for this message
Alberto Contreras (aciba) wrote :

I left some nit/quality comments. I have no context to this project so excuses in advance :)

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

> Output is indeed better now.
> And enough to have a quiet option indeed, thanks for thinking about that.
>
> A few things I thought about you tackled in later commits already.
>
> I consider myself not the best test reviewer, but you miss testing for dry-
> run.

Thanks, good point, I've added it.

> On the general concept I wanted to ask for more tests on the actual creation
> but then found tests/test_ppa_group.py which covers that already. So you are
> good, but while looking there auto-checkers showed me:
> "singleton-comparison: Comparison 'args.debug == True' should be 'args.debug
> is True' if checking for the singleton value True, or 'args.debug' if testing
> for truthiness"
>
> Maybe not for now (and it always depends which checkers style you want to
> follow) but a potential improvement later on?

Interesting, what are you running for that auto-checker?
I'd like to see if they have a more detailed justification for the case before deciding what to do.
Offhand I prefer the explicitness of '==' over just a truthiness test, but open to better ideas.

> Some minor improvement suggested inline.
> But generally +1
>
> @all - if one has deeper python test thoughts chime in.
> @Bryce - maybe I should bring it up in the Pro/CI standups which are more
> python heavy.

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

Thanks for the feedback, Alberto and Christian!

I've added stronger checking for the --architectures '' case, and the testcase for --dry-run mentioned above. For the other feedback I've left inline comments.

I'll leave the checker style adjustments to be handled separately once I've had a chance to study it; that change would affect all tests so should be a separate branch anyway.

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

To git+ssh://git.launchpad.net/ppa-dev-tools
   08102ce..222405e main -> main

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: