Merge ~bryce/ubuntu-helpers:add-trigger-class into ~ubuntu-server/+git/ubuntu-helpers:main
Proposed by
Bryce Harrington
Status: | Merged |
---|---|
Merge reported by: | Bryce Harrington |
Merged at revision: | b8b81821d61f040f94618b3bf65b682224256d43 |
Proposed branch: | ~bryce/ubuntu-helpers:add-trigger-class |
Merge into: | ~ubuntu-server/+git/ubuntu-helpers:main |
Diff against target: |
115 lines (+83/-7) 2 files modified
cpaelzer/lp-test-ppa (+46/-7) cpaelzer/smoketest_lp-test-ppa (+37/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christian Ehrhardt | Approve | ||
Canonical Server | Pending | ||
Canonical Server Reporter | Pending | ||
Review via email: mp+426849@code.launchpad.net |
Description of the change
This adds a Trigger class and cleans up the regex used to extract triggers.
The new additions aren't actually used in the code, but I've also included a super simple smoketest to check the functionality.
I've also been running it against a PPA as a real world test.
$ time lp-test-ppa ppa:sergiodj/
real 0m15.545s
user 0m0.674s
sys 0m0.109s
I've been hoping to find ways to make the code run quicker, however the performance is pretty much dominated by network I/O.
To post a comment you must log in.
# ack to add some testing, no matter how trivial - A few things here though
1. shouldn't it have a list of expected results to check?
2. Instead of just being an extra script, couldn't it (mabye not in this PR, but later) be a test in whatever python testing framework you wanted to use for the final thing?
3. The artifacts are not always reachable forever, please add a check if the fetch worked and if e.g. the expected number of lines came back. If not skip the asserts that should follow (see #1)
# Then on "Simplify regex for triggers"
1. It is fine to reduce the potential mass parsing, but could we be more explicit by using @@@@@@@ @@@@@@ test bed setup", 1) @@@@@@@ @@@@@@" , 1)
header_split = self.log.split(": @@@@@@@
instead of
header_split = self.log.split(": @@@@@@@
Then also the <2 makes more sense. Because otherwise you might split latter sections, the split will be >=2 but still might not contain what you expect.
2. could we define and compile the regex for ADT_TEST_TRIGGERS only if we passed the header split
That reads more like first header split, then regex to parse.
In addition for the (gladly unlikely) case that the header is bad you won't even compile the regex
# Trigger class
I like that this aligns things with each other, but as asked above comparing against expected output in the test - especially using this split package/ version/ arch/series as well as the stringified autopkgtest_url would help to test that.
# Finally
While all this is nice, I assume there will be changes that then use Triggers right?
Because otherwise while nice these changes will end up feeling odd.
So let me just ask for confirmation there will be users of this other than the test?
TL;DR: changes requested.
Great, a few small further enhancements/
My asks are all simple, feel free to merge yourself without re-review once you addressed them.