Merge lp:~bac/launchpad/ordered-load-list into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Gary Poster on 2012-05-01 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 15186 |
| Proposed branch: | lp:~bac/launchpad/ordered-load-list |
| Merge into: | lp:launchpad |
| Diff against target: |
61 lines (+24/-9) 1 file modified
lib/lp/services/testing/customresult.py (+24/-9) |
| To merge this branch: | bzr merge lp:~bac/launchpad/ordered-load-list |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gary Poster (community) | 2012-05-01 | Approve on 2012-05-01 | |
|
Review via email:
|
|||
Commit Message
Change bin/test --load-list to preserve the order presented in the original test list, at least within layers.
Description of the Change
= Summary =
"bin/test --load-list <fn>" loads the tests but then does not respect
their ordering due to the use of set() and the way the tests are
assigned to layers.
The approach presently taken makes sense from an efficiency standpoint
but at the cost of ordering. One of the great uses of --load-list is
to repeat a test run to find test isolation problems and that
utility is defeated if the ordering is not maintained.
== Proposed fix ==
Change 'filter_tests' to maintain order within a layer.
The order in which the layers are run may change, though that has not
been seen in practice. Should the layer ordering change, the tests
are still run in order per layer, which is probably sufficient for
isolating test failures.
== Pre-implementation notes ==
Chat with Gary.
== Implementation details ==
As above.
== Tests ==
bin/test --load-list in.txt --list-tests > out.txt
Then verify in.txt and out.txt are the same modulo the "Listing layer"
messages and any layer rearrangement issues as described above.
== Demo and Q/A ==
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
| Gary Poster (gary) wrote : | # |
| Brad Crittenden (bac) wrote : | # |
Thanks for the review Gary. I incorporated all of your suggestions.

Cool, thank you. This will be a big help.
A brief summary of our IRC conversation follows. All of these are negotiable.
- I don't think we should raise an exception if LP no longer has a test in the test list. The previous code did not have that behavior.
- ordered_layers isn't doing anything, and we should delete it.
- The suites_by_layer data structure is unnecessarily inefficient for the question you want to answer. If instead you build a map of test name to (layer, test), you can replace find_layers with a single hash lookup.
- We should include a comment as to why the code is maintaining order, so that future code navigators will have a clue as to intent.