venv: create venv & run pip in exec

Tempest deleted the venv management scripts [1] so now, puppet-tempest
is able to deploy the venv & run pip by itself.

[1] https://review.openstack.org/#/c/270564/

Also update Gemfile to install gems from puppet-openstack_spec_helper.
Both changes needed to be squashed otherwise CI will never pass.

Closes-Bug: #1570268
Change-Id: Iacfe61a14d69a8738a4cc4e2cfe29f7d54e91941
(cherry picked from commit e70aa88930)
This commit is contained in:
Emilien Macchi 2016-04-14 10:51:27 -04:00
parent b7aaccb924
commit df25a69282
4 changed files with 10 additions and 22 deletions

24
Gemfile
View File

@ -1,24 +1,10 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :development, :test do
gem 'puppetlabs_spec_helper', :require => 'false'
gem 'rspec-puppet', '~> 2.2.0', :require => 'false'
gem 'metadata-json-lint', :require => 'false'
gem 'puppet-lint-param-docs', :require => 'false'
gem 'puppet-lint-absolute_classname-check', :require => 'false'
gem 'puppet-lint-absolute_template_path', :require => 'false'
gem 'puppet-lint-trailing_newline-check', :require => 'false'
gem 'puppet-lint-unquoted_string-check', :require => 'false'
gem 'puppet-lint-leading_zero-check', :require => 'false'
gem 'puppet-lint-variable_contains_upcase', :require => 'false'
gem 'puppet-lint-numericvariable', :require => 'false'
gem 'json', :require => 'false'
end
group :system_tests do
gem 'beaker-rspec', :require => 'false'
gem 'beaker-puppet_install_helper', :require => 'false'
gem 'r10k', :require => 'false'
group :development, :test, :system_tests do
gem 'puppet-openstack_spec_helper',
:git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper',
:branch => 'stable/liberty',
:require => false
end
if facterversion = ENV['FACTER_GEM_VERSION']

View File

@ -260,7 +260,7 @@ class tempest(
if $setup_venv {
# virtualenv will be installed along with tox
exec { 'setup-venv':
command => "/usr/bin/python ${tempest_clone_path}/tools/install_venv.py",
command => "/usr/bin/virtualenv ${tempest_clone_path}/.venv && ${tempest_clone_path}/.venv/bin/pip install -U -r requirements.txt",
cwd => $tempest_clone_path,
unless => "/usr/bin/test -d ${tempest_clone_path}/.venv",
require => [

View File

@ -10,7 +10,7 @@ class tempest::params {
'openssl-devel',
'libffi-devel',
'patch',
'gcc',
'gcc'
]
}
'Debian': {
@ -23,6 +23,7 @@ class tempest::params {
'libffi-dev',
'patch',
'gcc',
'python-virtualenv',
]
}
default: {

View File

@ -241,7 +241,8 @@ describe 'tempest' do
'libssl-dev',
'libffi-dev',
'patch',
'gcc' ] }
'gcc',
'python-virtualenv' ] }
end
it_behaves_like 'tempest'