Merge ppa-dev-tools:job-class into ppa-dev-tools:main

Proposed by Bryce Harrington
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: 29e2c6593124656083bcfa933f30ba81ac15caa6
Proposed branch: ppa-dev-tools:job-class
Merge into: ppa-dev-tools:main
Diff against target: 713 lines (+683/-0)
5 files modified
.flake8 (+2/-0)
ppa/job.py (+183/-0)
tests/data/queues-20220822.json (+385/-0)
tests/data/running-20220822.json (+1/-0)
tests/test_job.py (+112/-0)
Reviewer Review Type Date Requested Status
Athos Ribeiro (community) Approve
Canonical Server Reporter Pending
Review via email: mp+428760@code.staging.launchpad.net

Description of the change

Imports the Job class from lp-test-ppa into ppa-dev-tools, adds docs, tests, and a bit more refactoring.

This is not hooked up to any commands in the ppa cli itself, but there's a smoke test using snapshot data you can run:

    $ python3 ./ppa/job.py

The tests can be run as well:

    $ pytest-3 ./tests/test_job.py

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

Nice work, Bryce :)

I left a couple inline comments, but this LGTM as is.

I am also wondering if instead of including the complete samples of the json files, including hand-crafted minimal samples of those would be enough. The reason for the question is that this change alone increased the project root size from <200kb to 1.9Mb (not counting git data here). While this shouldn't matter much ATM, I was wondering if there's any chance this could pile up in the future with new test additions.

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

> Nice work, Bryce :)
>
> I left a couple inline comments, but this LGTM as is.

Thanks!

> I am also wondering if instead of including the complete samples of the json
> files, including hand-crafted minimal samples of those would be enough. The
> reason for the question is that this change alone increased the project root
> size from <200kb to 1.9Mb (not counting git data here). While this shouldn't
> matter much ATM, I was wondering if there's any chance this could pile up in
> the future with new test additions.

Good point. Ironically I had started with hand-crafted snippets but switched to snapshots as being easier to add and more closely representative of actual usage. However, it may be better to just go ahead and add the code to download live data, and keep the local data snapshots trimmed to specific examples. You're right that over time this could pile up.

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

I've made the suggested changes, and trimmed down the data files. Will go ahead and land the branch.

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

Total 0 (delta 0), reused 0 (delta 0)
To git+ssh://git.launchpad.net/ppa-dev-tools
   6c1e1a8..8fcdc4f 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: