Merge lp://staging/~gmb/maas-test/add-reporting-follow-up into lp://staging/maas-test
Proposed by
Graham Binns
Status: | Merged |
---|---|
Approved by: | Graham Binns |
Approved revision: | 126 |
Merged at revision: | 99 |
Proposed branch: | lp://staging/~gmb/maas-test/add-reporting-follow-up |
Merge into: | lp://staging/maas-test |
Prerequisite: | lp://staging/~gmb/maas-test/add-reporting |
Diff against target: |
573 lines (+172/-78) 12 files modified
docs/man/maas-test.8.rst (+27/-0) maastest/console.py (+2/-1) maastest/main.py (+4/-2) maastest/parser.py (+8/-0) maastest/proxyfixture.py (+1/-0) maastest/report.py (+45/-30) maastest/tests/test_detect_dhcp.py (+1/-1) maastest/tests/test_maasfixture.py (+5/-2) maastest/tests/test_main.py (+1/-1) maastest/tests/test_report.py (+33/-18) maastest/tests/test_utils.py (+17/-17) maastest/utils.py (+28/-6) |
To merge this branch: | bzr merge lp://staging/~gmb/maas-test/add-reporting-follow-up |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Review via email:
|
Description of the change
This is a follow-up to my add-reporting branch in it, I:
- Reformatted imports using the format-imports utility.
- Added docstrings for BufferingOutput
- Made maas-test *always* saves test logs to disc unless told not to.
- Added options to not report to Launchpad and not report at all
To post a comment you must log in.
Delightful, thanks. A few notes as (almost) always.
.
It looks like a torn-off snippet of text landed inadvertently at the top of docs/man/ maas-test. 8.rst. A more complete version is about a hundred lines further down.
Where, by the way, it says "By defaults" where I would have expected "By default." And I notice you write "disk" in the documentation but "disc" in the MP — wasn't the last decision in our former Launchpad team to use British English? At any rate, "file" may avoid some unnecessary specificity.
.
In maastest/parser.py, the help texts for the new options are a bit long. Given that the manpage provides more extensive information anyway, can you think of more concise descriptions here? How about respectively “Log results only, do not store them or submit them to Launchpad” and “Store results, but do not submit them to Launchpad”?
.
It's a shame that report_ test_results( ) doesn't have more information about why creating a blob might fail. Also, shouldn't that timestamp be either (a) always in UTC, or (b) be logged with a timezone?
.
Typo: “def test_doest_ upload_ blob_if_ log_only_ set(self) :” has a “doest” where you probably meant either “doesnt” or, at a stretch, “doth” for 3rd person instead of 2nd.
Consider saying "does_not" instead.
.
In that same test, a spacing typo:
now =datetime(2013, 12, 17, 7, 18, 0)
Did you run "make lint"?
.
Just below that, you use mock.MagicMock. assert_ has_calls( ). Mock's design makes that dangerous. If you get everything right, the test passes. If you type it wrong, the test passes. If the assertion doesn't hold but you type it right, the test fails. If the assertion doesn't hold and you type it wrong, the test passes.
It may not seem like much of an issue because in TDD you watch the test fail before you make it pass, but code changes, conditions change, and you want to be sure the test doesn't become a broken alarm light. It's only a tiny change to self.assertIn( call(.. .), my_mock.mock_calls) which is less prone to false negatives.
.
Typo in the docstring for BufferingOutput Stream. __getattr_ _:
Also, it would be nice to stick to the Python convention of documenting in the imperative: "Pass through any attribute other than `write`."
.
Still in BufferingOutput Stream, why is the StringIO import not at the top of the file?
.
Finally, it's not clear to me that BufferingOutput Stream actually buffers. Everything about its names and documentation gives me the impression that it collects data in a buffer and only writes it to the stream when the buffer overflows or when the buffer is closed. But the code looks more like a "tee"!
Could you clear that up?
Jeroen