Skip to content

Commit f17eebc

Browse files
authored
Support install_method being 'none' (treydock#49)
Fixes treydock#47
1 parent 1eea013 commit f17eebc

File tree

11 files changed

+26
-13
lines changed

11 files changed

+26
-13
lines changed

.fixtures.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fixtures:
88
repo: puppetlabs/stdlib
99
firewall:
1010
repo: puppetlabs/firewall
11+
ref: '5.0.0'
1112
mysql:
1213
repo: puppetlabs/mysql
1314
concat:

.github/workflows/ci.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,3 @@ jobs:
8585
env:
8686
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet }}
8787
BEAKER_set: ${{ matrix.set }}
88-
BEAKER_destroy: 'no'
89-
- name: Debug failure
90-
if: failure()
91-
run: |
92-
docker exec slurm-${{ matrix.set }} cat /var/log/slurm/slurmd.log

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
1717
minor_version = ruby_version_segments[0..1].join('.')
1818

1919
group :development do
20-
gem "voxpupuli-test", '5.4.1', require: false
20+
gem "voxpupuli-test", '7.0.0', require: false
2121
gem "faraday", '~> 1.0', require: false
2222
gem "github_changelog_generator", require: false
2323
gem "puppet-blacksmith", require: false

manifests/common/install.pp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
}
1414
if $install_method == 'package' {
1515
$install_class = $package_class
16-
} else {
16+
} elsif $install_method == 'source' {
1717
$install_class = 'slurm::common::install::source'
1818
}
1919

20-
contain $install_class
20+
if $install_method != 'none' {
21+
contain $install_class
22+
}
2123
}

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188

189189
# Repo (optional)
190190
Optional[Variant[Stdlib::HTTPSUrl, Stdlib::HTTPUrl, Pattern[/^file:\/\//]]] $repo_baseurl = undef,
191-
Optional[Enum['package','source']] $install_method = undef,
191+
Optional[Enum['package','source','none']] $install_method = undef,
192192
Stdlib::Absolutepath $install_prefix = '/usr',
193193

194194
# Packages

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@
109109
],
110110
"pdk-version": "2.7.1",
111111
"template-url": "https://github.com/treydock/pdk-templates.git#master",
112-
"template-ref": "heads/master-0-g70732db"
112+
"template-ref": "heads/master-0-g76f4dbb"
113113
}

spec/acceptance/shared_examples/common_config.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
it { is_expected.to be_mode 644 }
77
it { is_expected.to be_owned_by 'root' }
88
it { is_expected.to be_grouped_into 'root' }
9-
# rubocop:disable RSpec/RepeatedDescription
109
its(:content) { is_expected.to match %r{^PartitionName=general Default=YES Nodes=slurmd State=UP$} }
1110
its(:content) { is_expected.to match %r{^NodeName=slurmd CPUs=1 State=UNKNOWN$} }
12-
# rubocop:enable RSpec/RepeatedDescription
1311
end
1412

1513
describe file('/etc/slurm/plugstack.conf'), node: node do

spec/acceptance/shared_examples/common_install.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ def packages
4646
it { is_expected.to be_installed.with_version(RSpec.configuration.slurm_version.to_s) }
4747
end
4848
end
49+
4950
shared_examples_for 'common::install-slurmctld' do |node|
5051
describe package(packages[:slurmctld]), node: node do
5152
it { is_expected.to be_installed.with_version(RSpec.configuration.slurm_version.to_s) }
5253
end
5354
end
55+
5456
shared_examples_for 'common::install-slurmdbd' do |node|
5557
describe package(packages[:slurmdbd]), node: node do
5658
it { is_expected.to be_installed.with_version(RSpec.configuration.slurm_version.to_s) }
5759
end
5860
end
61+
5962
shared_examples_for 'common::install-slurmrestd' do |node|
6063
describe package(packages[:slurmrestd]), node: node, unless: packages[:slurmrestd].nil? do
6164
it { is_expected.to be_installed.with_version(RSpec.configuration.slurm_version.to_s) }

spec/classes/slurm_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
describe 'slurm' do
66
on_supported_os.each do |os, os_facts|
7-
context "on #{os}" do
7+
context "with #{os}" do
88
let(:facts) do
99
os_facts.merge('processors' => { 'count' => 1 })
1010
end
@@ -46,6 +46,15 @@
4646
it_behaves_like 'slurm::common::install::source', os_facts
4747
end
4848

49+
context 'when install method is none' do
50+
let(:param_override) { { install_method: 'none' } }
51+
52+
it { is_expected.to compile.with_all_deps }
53+
it { is_expected.not_to contain_class('slurm::common::install::source') }
54+
it { is_expected.not_to contain_class('slurm::common::install::rpm') }
55+
it { is_expected.not_to contain_class('slurm::common::install::apt') }
56+
end
57+
4958
context 'when slurmd' do
5059
let(:client) { false }
5160
let(:slurmd) { true }

spec/shared_examples/slurm_common_install_apt.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@
3131
shared_examples_for 'slurm::common::install::apt-slurmd' do
3232
it { is_expected.to contain_package('slurmd').with_ensure('present').without_require }
3333
end
34+
3435
shared_examples_for 'slurm::common::install::apt-slurmctld' do
3536
it { is_expected.to contain_package('slurmctld').with_ensure('present').without_require }
3637
end
38+
3739
shared_examples_for 'slurm::common::install::apt-slurmdbd' do
3840
it { is_expected.to contain_package('slurmdbd').with_ensure('present').without_require }
3941
end

0 commit comments

Comments
 (0)