Merge ~chad.smith/cloud-init:cc-ntp-testing into cloud-init:master
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Scott Moser on 2017-05-24 | ||||
| Approved revision: | 29d0bb1cffd00ec3df0c2effd4a649af07390911 | ||||
| Merged at revision: | fd0c88cf8e8aa015eadb5ab842e872cb627197ec | ||||
| Proposed branch: | ~chad.smith/cloud-init:cc-ntp-testing | ||||
| Merge into: | cloud-init:master | ||||
| Diff against target: |
625 lines (+188/-304) 3 files modified
cloudinit/config/cc_ntp.py (+10/-15) tests/unittests/helpers.py (+26/-0) tests/unittests/test_handler/test_handler_ntp.py (+152/-289) |
||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | 2017-05-23 | Approve on 2017-05-24 | |
| Server Team CI bot | continuous-integration | Approve on 2017-05-24 | |
|
Review via email:
|
|||
Commit Message
cc_ntp: Restructure cc_ntp unit tests add with_logs class attr to unit tests.
Any CiTestCase subclass can now set a class attribute with_logs = True and tests can now make assertions on self.logs.
- greater risk: mocks are permanent within the scope, so multiple call-sites could be affected by package mocks
- less legible tests: each mock doesn't advertise the actual call-site
- tight coupling: the unit test logic to tightly bound to the actual implementation in remote (unrelated) modules which makes it more costly to maintain code
- false success: we should be testing the expected behavior not specific remote method names as we want to know if that underlying behavior changes and breaks us.
LP: #1692794
Description of the Change
cc_ntp: Restructure cc_ntp unit tests add with_logs class attr to unit tests.
Any CiTestCase subclass can now set a class attribute with_logs = True and tests can now make assertions on self.logs.
- greater risk: mocks are permanent within the scope, so multiple call-sites could be affected by package mocks
- less legible tests: each mock doesn't advertise the actual call-site
- tight coupling: the unit test logic to tightly bound to the actual implementation in remote (unrelated) modules which makes it more costly to maintain code
- false success: we should be testing the expected behavior not specific remote method names as we want to know if that underlying behavior changes and breaks us.
LP: #1692794
- e4f1154... by Chad Smith on 2017-05-23
PASSED: Continuous integration, rev:e4f11545162
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
some comments in line.
I'm generally in agreement here.
- 49c4eb8... by Chad Smith on 2017-05-23
PASSED: Continuous integration, rev:49c4eb85daa
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 15a8bc4... by Chad Smith on 2017-05-23
| Chad Smith (chad.smith) wrote : | # |
@scott Addressed your review comments thanks a lot. So unittest runtimes 1m30sec versus 2m20sec? Do we want to make the switch to have all CiTestCase subclasses logged?
FAILED: Continuous integration, rev:15a8bc4dbb7
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 29d0bb1... by Chad Smith on 2017-05-24
PASSED: Continuous integration, rev:29d0bb1cffd
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
I'm happy with this if you are.
You mentioned some improvement on the root_dir path calculation. You can do that here or in a follow on.
Just say which you want.
| Chad Smith (chad.smith) wrote : | # |
+1 let's land this as it's getting bigger. I've added a card/bug to work on a better root_dir path calculation in a followup.


FAILED: Continuous integration, rev:5ededba3f22 2795dea69af9d7d 7e187c3fdf8bba /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 377/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/377/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/377/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 377/console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/377/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/377/ console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 377/rebuild
https:/