Merge ~powersj/cloud-init:fix-cii-tree into cloud-init:master

Proposed by Joshua Powers
Status: Merged
Approved by: Scott Moser
Approved revision: 9d3be1bc53d931b60b017a6201b628534fd75984
Merged at revision: 9d0fdf1c6d39f8b6ff0f9e0172318bece56fed06
Proposed branch: ~powersj/cloud-init:fix-cii-tree
Merge into: cloud-init:master
Diff against target: 50 lines (+9/-7)
1 file modified
tests/cloud_tests/bddeb.py (+9/-7)
Reviewer Review Type Date Requested Status
Scott Moser Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+328260@code.launchpad.net

Commit message

tests: Fix build tree integration tests

The build deb command was no longer working because it had
assumed that you were in the root of the cloud-init directory.
This changes where the deb is built and changes how the
dependencies are determined as well as uses the built-in tools
for determining build dependencies.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:9d3be1bc53d931b60b017a6201b628534fd75984
https://jenkins.ubuntu.com/server/job/cloud-init-ci/105/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: CentOS 6 & 7: Build & Test
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/105/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

one question inline

review: Needs Information
Revision history for this message
Ryan Harper (raharper) :
Revision history for this message
Joshua Powers (powersj) wrote :

Responses inline

Revision history for this message
Scott Moser (smoser) wrote :

this is fine for now. at some point we might add a 'cd' option to execute that woudl start you in a provided directory.

review: Approve

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/cloud_tests/bddeb.py b/tests/cloud_tests/bddeb.py
2index 53dbf74..fe80535 100644
3--- a/tests/cloud_tests/bddeb.py
4+++ b/tests/cloud_tests/bddeb.py
5@@ -11,7 +11,7 @@ from tests.cloud_tests import (config, LOG)
6 from tests.cloud_tests import (platforms, images, snapshots, instances)
7 from tests.cloud_tests.stage import (PlatformComponent, run_stage, run_single)
8
9-build_deps = ['devscripts', 'equivs', 'git', 'tar']
10+pre_reqs = ['devscripts', 'equivs', 'git', 'tar']
11
12
13 def _out(cmd_res):
14@@ -26,13 +26,10 @@ def build_deb(args, instance):
15 @return_value: tuple of results and fail count
16 """
17 # update remote system package list and install build deps
18- LOG.debug('installing build deps')
19- pkgs = ' '.join(build_deps)
20+ LOG.debug('installing pre-reqs')
21+ pkgs = ' '.join(pre_reqs)
22 cmd = 'apt-get update && apt-get install --yes {}'.format(pkgs)
23 instance.execute(['/bin/sh', '-c', cmd])
24- # TODO Remove this call once we have a ci-deps Makefile target
25- instance.execute(['mk-build-deps', '--install', '-t',
26- 'apt-get --no-install-recommends --yes', 'cloud-init'])
27
28 # local tmpfile that must be deleted
29 local_tarball = tempfile.NamedTemporaryFile().name
30@@ -40,7 +37,7 @@ def build_deb(args, instance):
31 # paths to use in remote system
32 output_link = '/root/cloud-init_all.deb'
33 remote_tarball = _out(instance.execute(['mktemp']))
34- extract_dir = _out(instance.execute(['mktemp', '--directory']))
35+ extract_dir = '/root'
36 bddeb_path = os.path.join(extract_dir, 'packages', 'bddeb')
37 git_env = {'GIT_DIR': os.path.join(extract_dir, '.git'),
38 'GIT_WORK_TREE': extract_dir}
39@@ -56,6 +53,11 @@ def build_deb(args, instance):
40 instance.execute(['git', 'commit', '-a', '-m', 'tmp', '--allow-empty'],
41 env=git_env)
42
43+ LOG.debug('installing deps')
44+ deps_path = os.path.join(extract_dir, 'tools', 'read-dependencies')
45+ instance.execute([deps_path, '--install', '--test-distro',
46+ '--distro', 'ubuntu', '--python-version', '3'])
47+
48 LOG.debug('building deb in remote system at: %s', output_link)
49 bddeb_args = args.bddeb_args.split() if args.bddeb_args else []
50 instance.execute([bddeb_path, '-d'] + bddeb_args, env=git_env)

Subscribers

People subscribed via source and target branches