Skip to content

Commit

Permalink
Merge pull request #337 from bastelfreak/updates5
Browse files Browse the repository at this point in the history
mesos_exporter: update 1.0.0->1.1.2 & add acceptance tests
  • Loading branch information
bastelfreak authored Jul 15, 2019
2 parents 53a6824 + f22bc1f commit 047b883
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ prometheus::mesos_exporter::group: 'mesos-exporter'
prometheus::mesos_exporter::user: 'mesos-exporter'
prometheus::mesos_exporter::package_ensure: 'latest'
prometheus::mesos_exporter::package_name: 'mesos_exporter'
prometheus::mesos_exporter::version: '1.0.0'
prometheus::mesos_exporter::version: '1.1.2'
prometheus::haproxy_exporter::cnf_scrape_uri: 'http://localhost:1234/haproxy?stats;csv'
prometheus::haproxy_exporter::download_extension: 'tar.gz'
prometheus::haproxy_exporter::download_url_base: 'https://github.com/prometheus/haproxy_exporter/releases'
Expand Down
41 changes: 41 additions & 0 deletions spec/acceptance/mesos_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
require 'spec_helper_acceptance'

describe 'prometheus mesos exporter' do
it 'mesos_exporter works idempotently with no errors' do
pp = 'include prometheus::mesos_exporter'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('mesos_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe 'prometheus mesos exporter version 1.0.0' do
it 'mesos_exporter installs with version 1.0.0' do
pp = "class {'prometheus::mesos_exporter': version => '1.0.0' }"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe service('mesos_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
end

describe 'prometheus mesos exporter version 1.1.2' do
it 'mesos_exporter installs with version 1.1.2' do
pp = "class {'prometheus::mesos_exporter': version => '1.1.2' }"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe service('mesos_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
end
end
2 changes: 1 addition & 1 deletion spec/classes/mesos_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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') }
it { is_expected.to contain_file('/usr/local/bin/mesos_exporter').with('target' => '/opt/mesos_exporter-1.1.2.linux-amd64/mesos_exporter') }
end
end
end
Expand Down

0 comments on commit 047b883

Please sign in to comment.