Merge ~chad.smith/cloud-init:tests/slow-openstack-datasource-tests into cloud-init:master

Proposed by Chad Smith
Status: Merged
Merged at revision: 5582e4a266118b63ff86b6258b23d66df6d129d5
Proposed branch: ~chad.smith/cloud-init:tests/slow-openstack-datasource-tests
Merge into: cloud-init:master
Diff against target: 21 lines (+3/-0)
1 file modified
tests/unittests/test_datasource/test_openstack.py (+3/-0)
Reviewer Review Type Date Requested Status
Joshua Powers (community) Approve
Server Team CI bot continuous-integration Approve
cloud-init Commiters Pending
Review via email: mp+330253@code.launchpad.net

Description of the change

tests: mock missed openstack metadata uri network_data.json

This missed mock in test_openstack resulted in a costly unit test timeout.

LP: #1714376

To post a comment you must log in.
Revision history for this message
Chad Smith (chad.smith) wrote :

Leaving the overhaul of register_mock_metaserver for a separate branch which would consolidate AliYun, Ec2 and OpenStack tests to use the same httpretty mocking pattern.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:3bf90001d62ead9ffd01630f688fea021b0d63d0
https://jenkins.ubuntu.com/server/job/cloud-init-ci/261/
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://jenkins.ubuntu.com/server/job/cloud-init-ci/261/rebuild

review: Approve (continuous-integration)
Revision history for this message
Joshua Powers (powersj) wrote :

Huge +1 to this change. Python2 tests now take 3.985 seconds and python3 tests take 4.147 seconds.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unittests/test_datasource/test_openstack.py b/tests/unittests/test_datasource/test_openstack.py
2index 177e980..ed367e0 100644
3--- a/tests/unittests/test_datasource/test_openstack.py
4+++ b/tests/unittests/test_datasource/test_openstack.py
5@@ -57,6 +57,8 @@ OS_FILES = {
6 'openstack/content/0000': CONTENT_0,
7 'openstack/content/0001': CONTENT_1,
8 'openstack/latest/meta_data.json': json.dumps(OSTACK_META),
9+ 'openstack/latest/network_data.json': json.dumps(
10+ {'links': [], 'networks': [], 'services': []}),
11 'openstack/latest/user_data': USER_DATA,
12 'openstack/latest/vendor_data.json': json.dumps(VENDOR_DATA),
13 }
14@@ -68,6 +70,7 @@ EC2_VERSIONS = [
15 ]
16
17
18+# TODO _register_uris should leverage test_ec2.register_mock_metaserver.
19 def _register_uris(version, ec2_files, ec2_meta, os_files):
20 """Registers a set of url patterns into httpretty that will mimic the
21 same data returned by the openstack metadata service (and ec2 service)."""

Subscribers

People subscribed via source and target branches