Merge ppa-dev-tools:add_to_dict into ppa-dev-tools:main

Proposed by Bryce Harrington
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: 4fa781ab4b74ee879971f3149cb56656f660bd76
Proposed branch: ppa-dev-tools:add_to_dict
Merge into: ppa-dev-tools:main
Diff against target: 390 lines (+208/-3)
9 files modified
.pylintrc (+1/-1)
ppa/job.py (+24/-2)
ppa/result.py (+24/-0)
ppa/subtest.py (+18/-0)
ppa/trigger.py (+20/-0)
tests/test_job.py (+30/-0)
tests/test_result.py (+37/-0)
tests/test_subtest.py (+26/-0)
tests/test_trigger.py (+28/-0)
Reviewer Review Type Date Requested Status
Athos Ribeiro (community) Approve
Canonical Server packageset reviewers Pending
PpaDevTools Developers Pending
Canonical Server Reporter Pending
Review via email: mp+445685@code.staging.launchpad.net

Description of the change

This adds functionality to represent objects related to autopkgtest results as simple dicts.
This is groundwork towards adding a --json or --format=json flag.

The formal testsuite can be checked via:

  $ make check

or

  $ pytest-3 .

The individual smoketests for each object can also be individually run; these are intended more for human review of object behavior, and will show what the JSON output looks like for visual inspection:

  $ python3 -m ppa.job
  $ python3 -m ppa.subtest
  $ python3 -m ppa.trigger
  $ python3 -m ppa.result

The test_to_dict() implementations are very similar, to the point of being pretty repetitive. I experimented with pulling out some common code into helper routines but it started proving more complex than helpful and didn't result in better code clarity. However, keeping the implementations code-consistent is a bit of a pain, so if you have ideas on how to refactor these into fewer lines of code, suggestions would be most welcome.

To post a comment you must log in.
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

LGTM!

Thanks, Bryce :)

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

Thanks, merged.

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: