Skip to content

Commit

Permalink
MERGE WITH e969c7c
Browse files Browse the repository at this point in the history
In e969c7c, we remove the code related
to `pe_compiling_server_aio_build` which was unused.  The unit tests
that where testing / tweaking it can be removed.
  • Loading branch information
smortex committed Jul 26, 2023
1 parent 7412459 commit 18b09d1
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 47 deletions.
2 changes: 0 additions & 2 deletions spec/classes/puppet_agent_osfamily_aix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

before(:each) do
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) { |_args| '2000.0.0' }
Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) { |_args| '1.10.100' }
end

it { is_expected.to contain_file('/opt/puppetlabs') }
Expand Down Expand Up @@ -75,7 +74,6 @@

before(:each) do
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) { |_args| '2000.0.0' }
Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) { |_args| '1.10.100' }
end

it {
Expand Down
5 changes: 0 additions & 5 deletions spec/classes/puppet_agent_osfamily_darwin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
require 'spec_helper'

describe 'puppet_agent' do
master_package_version = '1.10.100'
before(:each) do
# Need to mock the PE functions
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
master_package_version
end

allow(Puppet::FileSystem).to receive(:exist?).and_call_original
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).and_call_original
allow(Puppet::FileSystem).to receive(:exist?).with('/opt/puppetlabs/puppet/VERSION').and_return true
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

let(:facts) do
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
'5.5.4'
end
end

let(:facts) do
Expand Down
8 changes: 0 additions & 8 deletions spec/classes/puppet_agent_osfamily_solaris_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ def install_script(ver, arch)
pe_version
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end

# Ensure we get a versionable package provider
pkg = Puppet::Type.type(:package)
allow(pkg).to receive(:defaultprovider).and_return(pkg.provider(:pkg))
Expand Down Expand Up @@ -310,10 +306,6 @@ def install_script(ver, arch)
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
pe_version
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

let(:facts) do
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_suse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

describe 'supported environment' do
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_windows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
pe_version
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end

allow(Puppet::Util).to receive(:absolute_path?).and_call_original
allow(Puppet::Util).to receive(:absolute_path?).with(version_file).and_return true
allow(Puppet::FileSystem).to receive(:exist?).and_call_original
Expand Down
12 changes: 0 additions & 12 deletions spec/classes/puppet_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@ def global_facts(facts, os)
end
end

context 'package_version is undef if pe_compiling_server_aio_build is not defined' do
let(:facts) do
global_facts(facts, os).merge(is_pe: true)
end

it { is_expected.to contain_class('puppet_agent').with_package_version(nil) }
end

context 'package_version is same as master when set to auto' do
let(:params) { { package_version: 'auto' } }
let(:node_params) { { serverversion: '7.6.5' } }
Expand Down Expand Up @@ -268,10 +260,6 @@ def global_facts(facts, os)
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
'1.10.100'
end
end
end

Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_windows_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'4.10.100'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

let(:facts) { facts.merge({ is_pe: true }) }
Expand Down

0 comments on commit 18b09d1

Please sign in to comment.