Merge ~chad.smith/cloud-init:bug/ec2-tests-unmocked-metadata into cloud-init:master
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | 1770a1eb647d24e14732194e72210ea494986ad2 | ||||
| Proposed branch: | ~chad.smith/cloud-init:bug/ec2-tests-unmocked-metadata | ||||
| Merge into: | cloud-init:master | ||||
| Diff against target: |
102 lines (+30/-16) 1 file modified
tests/unittests/test_datasource/test_ec2.py (+30/-16) |
||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve on 2017-08-31 | |
| Joshua Powers (community) | Approve on 2017-08-31 | ||
| cloud-init commiters | 2017-08-31 | Pending | |
|
Review via email:
|
|||
Commit Message
ec2 tests: Stop leaking calls through unmocked metadata addresses
DataSourceEc2 behavior changed to first check a minimum acceptable
metadata version uri http://
retrying on 404, until the metadata service is available. After the
metadata service is up, the datasource inspects preferred
extended_
preferred extended_
attempts against
http://
time cost to the unit test runs.
This branch uses httpretty to properly mock the following:
- 404s from metadata on undesired extended_
- https:/
- full metadata dictionary represented on min_metadata_
- https:/
The branch also tightens httpretty to raise a MockError for any URL
which isn't mocked via httpretty.
LP: #1714117
Description of the Change
ec2 tests: Stop leaking calls through unmocked metadata addresses
DataSourceEc2 behavior changed to first check a minimum acceptable
metadata version uri http://
retrying on 404, until the metadata service is available. After the
metadata service is up, the datasource inspects preferred
extended_
preferred extended_
attempts against
http://
time cost to the unit test runs.
This branch uses httpretty to properly mock the following:
- 404s from metadata on undesired extended_
- https:/
- full metadata dictionary represented on min_metadata_
- https:/
The branch also tightens httpretty to raise a MockError for any URL
which isn't mocked via httpretty.
LP: #1714117
FAILED: Continuous integration, rev:d817633406d
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 53e97d2... by Chad Smith on 2017-08-31
PASSED: Continuous integration, rev:53e97d2da7f
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/


Ran on the test system and was back to under 20 seconds for each environment. Add link to bug (LP: 1714117), fix style tests, and this is good to go!
tests/unittests /test_datasourc e/test_ ec2.py: 6:1: F401 're' imported but unused /test_datasourc e/test_ ec2.py: 203:24: E114 indentation is not a multiple of four (comment) /test_datasourc e/test_ ec2.py: 207:24: E114 indentation is not a multiple of four (comment) /test_datasourc e/test_ ec2.py: 208:24: E111 indentation is not a multiple of four
tests/unittests
tests/unittests
tests/unittests