Merge lp:~chris.macnaughton/charm-helpers/pids-can-be-a-list into lp:charm-helpers
| Status: | Merged |
|---|---|
| Merged at revision: | 562 |
| Proposed branch: | lp:~chris.macnaughton/charm-helpers/pids-can-be-a-list |
| Merge into: | lp:charm-helpers |
| Diff against target: |
121 lines (+76/-10) 2 files modified
charmhelpers/contrib/amulet/utils.py (+15/-10) tests/contrib/amulet/test_utils.py (+61/-0) |
| To merge this branch: | bzr merge lp:~chris.macnaughton/charm-helpers/pids-can-be-a-list |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Ryan Beisner | Approve on 2016-04-05 | ||
| charmers | 2016-03-03 | Pending | |
|
Review via email:
|
|||
Description of the Change
Allow the validate_
| Ryan Beisner (1chb1n) wrote : | # |
4. (amulet) test that is.
| Ryan Beisner (1chb1n) wrote : | # |
5. Please also add a simple 1-liner docstring to each new unit test case so that when nosetests are run verbosely, we see that output.
| Ryan Beisner (1chb1n) wrote : | # |
Ha! Never mind 5. You've already done that. I just can't read apparently.
- 537. By Chris MacNaughton on 2016-03-15
-
review updates
Do you still want to see the changes against ceph-osd Ryan, or are the test cases enough to make you comfortable?
| Ryan Beisner (1chb1n) wrote : | # |
Thanks for the unit test coverage on this. That shows that the behavior is as intended. If we are to omit a sync/amulet test, we should also add negative unit tests here, where you pass bad scenarios and assert that the validation method has returned something other than None.
Can you add 1-per? That would make this rock solid.
- 538. By Chris MacNaughton on 2016-04-05
-
add negative proofs
| Ryan Beisner (1chb1n) wrote : | # |
I'm seeing test_accepts_
| Ryan Beisner (1chb1n) wrote : | # |
Please update the *_wrong docstrings to reflect the negative aspect.
Also, I believe the *_wrong assertions should be IsNotNone.
- 539. By Chris MacNaughton on 2016-04-05
-
fix test


1. See inline comments. That existing validation block is already particularly non-beautiful ;-) and the commentary helps clarify. Let's keep that consistent in that block.
2. The variable name e_pids_length (expected process IDs length) makes sense for the existing validation blocks, but it is confusing/mis-named in the context of it being a list type. Ideas to address that?
3. I'd like to see this validated before merge by syncing this c-h LP branch into ceph-mon, then updating basic_deployment.py like so:
<icey> a ceph-mon test /review. openstack. org/#/c/ 287446/ 7/tests/ basic_deploymen t.py
<icey> looking...
<icey> beisner: https:/
<icey> line 185, changed from {'ceph-osd': 2} to {'ceph-osd': True}
<icey> would rather be: {'ceph-osd': [2, 3]}
4. And finally by running the test, capturing and commenting here with a pastebin of the test
output.