Merge lp:~mars/launchpad/turn-on-windmill-debug-logging into lp:launchpad
Proposed by
Māris Fogels
Status: | Merged |
---|---|
Approved by: | Māris Fogels |
Approved revision: | no longer in the source branch. |
Merged at revision: | 10846 |
Proposed branch: | lp:~mars/launchpad/turn-on-windmill-debug-logging |
Merge into: | lp:launchpad |
Diff against target: |
141 lines (+72/-25) 3 files modified
lib/canonical/config/schema-lazr.conf (+8/-1) lib/canonical/testing/__init__.py (+0/-4) lib/canonical/testing/layers.py (+64/-20) |
To merge this branch: | bzr merge lp:~mars/launchpad/turn-on-windmill-debug-logging |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | code | Approve | |
Review via email: mp+24839@code.launchpad.net |
Commit message
Make the windmill test suite log debug messages to disk.
Description of the change
Hi,
This branch configures the windmill test suite to log debug messages to a file on disk.
Drive-by changes include removal of a long-released XXX, extraction of the windmill suite setup steps into their own methods, and a comment typo.
I manually tested this change to ensure that the suite still runs, and that the windmill log file is being overwritten properly. I also ensured that the logging framework is reset when the layer finishes.
Test command: bin/test -t test_title_
Lint: none
Maris
To post a comment you must log in.
<rockstar> mars, does reset_logging undo all of this logger buggery you're doing here?
<mars> rockstar, it does
<mars> rockstar, BaseLayer calls it as well, but I did this because it is more visible and explicit
<rockstar> mars, what does safe_hasattr do?
<mars> rockstar, doesn't eat exceptions. Builtin hasattr does (fun fun!)
<rockstar> mars, why not just use getattr?
<mars> rockstar, what line?
<mars> 96
<rockstar> mars, yes.
<mars> rockstar, it might be because hasattr will tell you that an attribute exists. getattr may return None, but you can't tell if that is the attribute's value, or the default argument.
<mars> or the default argument to getattr()
<rockstar> mars, okay. As long as you feel you're using the right call here, I'm happy with that.
<mars> rockstar, not my code, so it should work :)
<mars> rockstar, that is one of the code blocks I extracted into its own method
<mars> personal choice: I dislike 300 and 400 line method definitions, even if they are linear.
<mars> if there are comments that say "# now we do this" followed by "# then we do that", then it is pretty good sign that you can extract a method
<mars> but, like I said, that's personal preference
<rockstar> mars, I think you've made the code clearer by breaking it up.