From d68cadb1a80f95a36dae81d6f3d1375ae4472698 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Fri, 14 Jun 2019 15:58:26 -0700 Subject: [PATCH] Drop poise-python in favor of directly installing python packages The poise-python cookbook is no longer maintained by the upstream maintainer and is causing lots of issues for the testing pipeline. Instead, install tempest directly using pip via an execute resource. Change-Id: I6991581056d6037eb269a6753b1af7e5c2ba7d90 Signed-off-by: Lance Albertson --- metadata.rb | 2 -- recipes/setup.rb | 15 +++++++-------- spec/setup_spec.rb | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/metadata.rb b/metadata.rb index 7a59a41..f538843 100644 --- a/metadata.rb +++ b/metadata.rb @@ -19,8 +19,6 @@ depends 'openstack-compute', '>= 18.0.0' depends 'openstack-block-storage', '>= 18.0.0' depends 'openstackclient' -depends 'poise-python' - issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url) source_url 'https://github.com/openstack/cookbook-openstack-integration-test' if respond_to?(:source_url) chef_version '>= 12.5' if respond_to?(:chef_version) diff --git a/recipes/setup.rb b/recipes/setup.rb index c8d5342..e4eaf3d 100644 --- a/recipes/setup.rb +++ b/recipes/setup.rb @@ -83,20 +83,19 @@ connection_params = { end end +include_recipe 'openstack-common' + tempest_path = '/opt/tempest' venv_path = '/opt/tempest-venv' -python_virtualenv venv_path do - pip_version '18.0' - setuptools_version '40.0.0' - wheel_version '0.31.1' +execute "virtualenv #{venv_path}" do + creates venv_path end -python_execute 'install tempest' do +execute 'install tempest' do action :nothing - command '-m pip install .' + command "#{venv_path}/bin/pip install ." cwd tempest_path - virtualenv venv_path end git tempest_path do @@ -104,7 +103,7 @@ git tempest_path do reference '17.2.0' depth 1 action :sync - notifies :run, 'python_execute[install tempest]', :immediately + notifies :run, 'execute[install tempest]', :immediately end template "#{venv_path}/tempest.sh" do diff --git a/spec/setup_spec.rb b/spec/setup_spec.rb index 9092fbd..0b57052 100644 --- a/spec/setup_spec.rb +++ b/spec/setup_spec.rb @@ -91,6 +91,18 @@ describe 'openstack-integration-test::setup' do ) end + it do + expect(chef_run).to run_execute('virtualenv /opt/tempest-venv').with(creates: '/opt/tempest-venv') + end + + it do + expect(chef_run).to nothing_execute('install tempest') + .with( + command: '/opt/tempest-venv/bin/pip install .', + cwd: '/opt/tempest' + ) + end + it 'syncs /opt/tempest from github' do expect(chef_run).to sync_git( '/opt/tempest' @@ -101,6 +113,10 @@ describe 'openstack-integration-test::setup' do ) end + it do + expect(chef_run.git('/opt/tempest')).to notify('execute[install tempest]').to(:run).immediately + end + it 'uploads image1' do expect(chef_run).to upload_openstack_image_image('image1').with( identity_user: 'admin',