Skip to content

Commit

Permalink
rework tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Mar 17, 2018
1 parent 622df21 commit 7f2db3a
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 18 deletions.
3 changes: 2 additions & 1 deletion spec/classes/alertmanager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.9.1',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/beanstalkd_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '1.0.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
1 change: 1 addition & 0 deletions spec/classes/blackbox_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
version: '0.6.0',
arch: 'amd64',
os: 'linux',
bin_dir: '/usr/local/bin',
modules: {
'http_2xx' => {
'prober' => 'http'
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/consul_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.3.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/elasticsearch_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '1.0.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/haproxy_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.7.1',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/mongodb_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.3.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/nginx_vts_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.6',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/node_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
{
version: '0.13.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
7 changes: 4 additions & 3 deletions spec/classes/prometheus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
facts
end

[{}, { version: '2.0.0-rc.1' }].each do |parameters|
[{ version: '2.0.0-rc.1', bin_dir: '/usr/local/bin', install_method: 'url' }].each do |parameters|
context "with parameters #{parameters}" do
let(:params) do
parameters
Expand Down Expand Up @@ -116,7 +116,7 @@
'content' => File.read(fixtures('files', "prometheus#{prom_major}.sysv"))
)
}
elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64'].include?(os)
elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64', 'archlinux-4-x86_64'].include?(os)
# init_style = 'systemd'

it { is_expected.to contain_class('systemd') }
Expand Down Expand Up @@ -203,6 +203,7 @@
context 'with alerts configured', alerts: true do
[
{
version: '1.5.3',
alerts: [{
'name' => 'alert_name',
'condition' => 'up == 0',
Expand Down Expand Up @@ -236,7 +237,7 @@
parameters
end

prom_version = parameters[:version] || '1.5.2'
prom_version = parameters[:version]
prom_major = prom_version[0]

it {
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/pushgateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.4.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/rabbitmq_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '1.0.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/redis_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.11.2',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/classes/snmp_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
version: '0.6.0',
arch: 'amd64',
os: 'linux'
os: 'linux',
bin_dir: '/usr/local/bin'
}
end

Expand Down
3 changes: 2 additions & 1 deletion spec/defines/alerts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

[
{
version: '1.5.2',
alerts: [
{
'name' => 'alert_name',
Expand Down Expand Up @@ -62,7 +63,7 @@
parameters
end

prom_version = parameters[:version] || '1.5.2'
prom_version = parameters[:version]
prom_major = prom_version[0]

it {
Expand Down
5 changes: 3 additions & 2 deletions spec/defines/daemon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
notify_service: 'Service[smurf_exporter]',
user: 'smurf_user',
group: 'smurf_group',
env_vars: { SOMEVAR: 42 }
env_vars: { SOMEVAR: 42 },
bin_dir: '/usr/local/bin'
}
].each do |parameters|
context "with parameters #{parameters}" do
Expand Down Expand Up @@ -102,7 +103,7 @@
%r{daemon --user=smurf_user \\\n --pidfile="\$PID_FILE" \\\n "\$DAEMON" '' >> "\$LOG_FILE" &}
)
}
elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64'].include?(os)
elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64', 'archlinux-4-x86_64'].include?(os)
# init_style = 'systemd'

it { is_expected.to contain_class('systemd') }
Expand Down

0 comments on commit 7f2db3a

Please sign in to comment.