Skip to content

Commit

Permalink
Merge pull request #340 from bastelfreak/updates8
Browse files Browse the repository at this point in the history
process_exporter: update 0.1.0->0.5.0 & add acceptance tests
  • Loading branch information
bastelfreak committed Jul 15, 2019
2 parents 5050026 + fb4e127 commit b6130da
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ prometheus::process_exporter::group: 'process-exporter'
prometheus::process_exporter::package_ensure: 'latest'
prometheus::process_exporter::package_name: 'process-exporter'
prometheus::process_exporter::user: 'process-exporter'
prometheus::process_exporter::version: '0.1.0'
prometheus::process_exporter::version: '0.5.0'
prometheus::process_exporter::config_path: '/etc/process-exporter.yaml'
prometheus::pushgateway::download_extension: 'tar.gz'
prometheus::pushgateway::download_url_base: 'https://github.com/prometheus/pushgateway/releases'
Expand Down
52 changes: 52 additions & 0 deletions spec/acceptance/process_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
require 'spec_helper_acceptance'

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

describe service('process-exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9256) do
it { is_expected.to be_listening.with('tcp6') }
end

describe 'process_exporter update from 0.1.0 to 0.5.0' do
it 'is idempotent' do
pp = "class{'prometheus::process_exporter': version => '0.1.0'}"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('process-exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9256) do
it { is_expected.to be_listening.with('tcp6') }
end
it 'is idempotent' do
pp = "class{'prometheus::process_exporter': version => '0.5.0'}"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('process-exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9256) do
it { is_expected.to be_listening.with('tcp6') }
end
end
end

0 comments on commit b6130da

Please sign in to comment.