From 60a5fee8c3832fa862f0b8802d5064c7caf5ed73 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 14 Jul 2019 13:01:21 +0200 Subject: [PATCH 1/2] mesos_exporter: add unit tests --- spec/classes/mesos_exporter_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 spec/classes/mesos_exporter_spec.rb diff --git a/spec/classes/mesos_exporter_spec.rb b/spec/classes/mesos_exporter_spec.rb new file mode 100644 index 000000000..d2a4611ce --- /dev/null +++ b/spec/classes/mesos_exporter_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe 'prometheus::mesos_exporter' do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge(os_specific_facts(facts)) + end + + context 'with version specified' do + let :params do + { + bin_dir: '/usr/local/bin', + install_method: 'url' + } + end + + describe 'compile manifest' do + it { is_expected.to compile.with_all_deps } + end + + describe 'install correct binary' do + it { is_expected.to contain_file('/usr/local/bin/mesos_exporter').with('target' => '/opt/mesos_exporter-1.0.0.linux-amd64/mesos_exporter') } + end + end + end + end +end From 58cabe0189f4c65ec1dc1f11ed60202b81ba2a1d Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 14 Jul 2019 13:01:51 +0200 Subject: [PATCH 2/2] mesos_exporter: Fix bug/typo in parameter assignment --- manifests/mesos_exporter.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/mesos_exporter.pp b/manifests/mesos_exporter.pp index 73386dc8d..9419a73ef 100644 --- a/manifests/mesos_exporter.pp +++ b/manifests/mesos_exporter.pp @@ -95,7 +95,7 @@ Boolean $manage_group = true, Boolean $manage_service = true, Boolean $manage_user = true, - String $os = $prometheu::os, + String $os = $prometheus::os, String $extra_options = '', Optional[String] $download_url = undef, String $arch = $prometheus::real_arch,