Skip to content

Commit

Permalink
Merge pull request voxpupuli#545 from voxpupuli/depb
Browse files Browse the repository at this point in the history
switch from stahnma/epel to puppet/epel / Ubuntu 16.04: Execute tests on Python 3
  • Loading branch information
bastelfreak committed Apr 26, 2020
2 parents 9b0ea97 + b03ad20 commit b48ed4e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .fixtures.yml
@@ -1,7 +1,7 @@
fixtures:
repositories:
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
epel: 'https://github.com/stahnma/puppet-module-epel.git'
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
epel: https://github.com/voxpupuli/puppet-epel.git
yumrepo_core:
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
puppet_version: ">= 6.0.0"
4 changes: 2 additions & 2 deletions metadata.json
Expand Up @@ -65,8 +65,8 @@
"version_requirement": ">= 4.19.0 < 7.0.0"
},
{
"name": "stahnma/epel",
"version_requirement": ">= 1.2.2 < 2.0.0"
"name": "puppet/epel",
"version_requirement": ">= 3.0.0 < 4.0.0"
}
]
}
8 changes: 4 additions & 4 deletions spec/acceptance/facts_test_spec.rb
Expand Up @@ -11,10 +11,10 @@ class { 'python' :
EOS

fact_notices = <<-EOS
notify{"pip_version: ${::pip_version}":}
notify{"system_python_version: ${::system_python_version}":}
notify{"python_version: ${::python_version}":}
notify{"virtualenv_version: ${::virtualenv_version}":}
notify{"pip_version: ${facts['pip_version']}":}
notify{"system_python_version: ${facts['system_python_version']}":}
notify{"python_version: ${facts['python_version']}":}
notify{"virtualenv_version: ${facts['virtualenv_version']}":}
EOS

# rubocop:disable RSpec/RepeatedExample
Expand Down
60 changes: 42 additions & 18 deletions spec/acceptance/virtualenv_spec.rb
Expand Up @@ -5,17 +5,21 @@
# Using puppet_apply as a helper
it 'works with no errors' do
pp = <<-EOS
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '16.04' {
$version = '3'
} else {
$version = 'system'
}
class { 'python' :
version => 'system',
version => $version,
pip => 'present',
virtualenv => 'present',
}
-> python::virtualenv { 'venv' :
ensure => 'present',
version => $version,
systempkgs => false,
venv_dir => '/opt/venv',
owner => 'root',
group => 'root',
}
-> python::pip { 'rpyc' :
ensure => '3.2.3',
Expand All @@ -30,17 +34,21 @@ class { 'python' :

it 'maintains pip version' do
pp = <<-EOS
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '16.04' {
$version = '3'
} else {
$version = 'system'
}
class { 'python' :
version => 'system',
version => $version,
pip => 'present',
virtualenv => 'present',
}
-> python::virtualenv { 'venv' :
ensure => 'present',
version => $version,
systempkgs => false,
venv_dir => '/opt/venv2',
owner => 'root',
group => 'root',
}
-> python::pip { 'pip' :
ensure => '18.0',
Expand All @@ -55,17 +63,21 @@ class { 'python' :

it 'works with ensure=>latest' do
pp = <<-EOS
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '16.04' {
$version = '3'
} else {
$version = 'system'
}
class { 'python' :
version => 'system',
version => $version,
pip => 'present',
virtualenv => 'present',
}
-> python::virtualenv { 'venv' :
ensure => 'present',
version => $version,
systempkgs => false,
venv_dir => '/opt/venv3',
owner => 'root',
group => 'root',
}
-> python::pip { 'rpyc' :
ensure => 'latest',
Expand All @@ -82,17 +94,21 @@ class { 'python' :

it 'works with ensure=>latest for package with underscore in its name' do
pp = <<-EOS
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '16.04' {
$version = '3'
} else {
$version = 'system'
}
class { 'python' :
version => 'system',
version => $version,
pip => 'present',
virtualenv => 'present',
}
-> python::virtualenv { 'venv' :
ensure => 'present',
version => $version,
systempkgs => false,
venv_dir => '/opt/venv4',
owner => 'root',
group => 'root',
}
-> python::pip { 'int_date' :
ensure => 'latest',
Expand All @@ -109,20 +125,24 @@ class { 'python' :

it 'works with editable=>true' do
pp = <<-EOS
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '16.04' {
$version = '3'
} else {
$version = 'system'
}
package{ 'git' :
ensure => 'present',
}
-> class { 'python' :
version => 'system',
version => $version,
pip => 'present',
virtualenv => 'present',
}
-> python::virtualenv { 'venv' :
ensure => 'present',
version => $version,
systempkgs => false,
venv_dir => '/opt/venv5',
owner => 'root',
group => 'root',
}
-> python::pip { 'rpyc' :
ensure => '4.1.0',
Expand All @@ -139,17 +159,21 @@ class { 'python' :

it 'works with == in pkgname' do
pp = <<-EOS
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '16.04' {
$version = '3'
} else {
$version = 'system'
}
class { 'python' :
version => 'system',
version => $version,
pip => 'present',
virtualenv => 'present',
}
-> python::virtualenv { 'venv' :
ensure => 'present',
version => $version,
systempkgs => false,
venv_dir => '/opt/venv6',
owner => 'root',
group => 'root',
}
-> python::pip { 'rpyc==4.1.0' :
virtualenv => '/opt/venv6',
Expand Down

0 comments on commit b48ed4e

Please sign in to comment.