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 | |
Joshua Powers (community) | Approve | ||
cloud-init Commiters | 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
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